Skip to content

Commit

Permalink
Merge pull request #224 from AppsFlyerSDK/6.8.0
Browse files Browse the repository at this point in the history
6.8.0
- The API enableLocationCollection has been removed.
- The API setDisableNetworkData has been added.
- The AD_ID permission has been added to the plugin.
- Updated AppsFlyer Android SDK to v6.8.0
- Updated AppsFlyer iOS SDK to v6.8.0
  • Loading branch information
af-do authored Aug 7, 2022
2 parents dcf316e + f6ccaf6 commit 5344086
Show file tree
Hide file tree
Showing 13 changed files with 125 additions and 78 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# Versions
## 6.8.0
- The API `enableLocationCollection` has been removed.
- The API `setDisableNetworkData` has been added.
- The AD_ID permission has been added to the plugin.
- Updated AppsFlyer Android SDK to v6.8.0
- Updated AppsFlyer iOS SDK to v6.8.0
## 6.5.2+2
## 6.5.2+1
- New APIs: getOutOfStore, setOutOfStore, setResolveDeepLinkURLs, setPartnerData
Expand Down
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@

### <a id="plugin-build-for"> This plugin is built for

- Android AppsFlyer SDK **v6.5.2**
- iOS AppsFlyer SDK **v6.5.2**
- Android AppsFlyer SDK **v6.8.0**
- iOS AppsFlyer SDK **v6.8.0**

## <a id="breaking-changes"> ❗❗ Breaking changes when updating to v6.x.x❗❗

If you have used one of the removed/changed APIs, please check the integration guide for the updated instructions.

- From version `6.8.0`, the `enableLocationCollection` has been removed from the plugin.

- From version `6.4.0`, UDL (Unified deep link) now as a dedicated class with getters for handling the deeplink result.
[Check the full UDL guide](https://github.com/AppsFlyerSDK/appsflyer-flutter-plugin/blob/master/doc/Guides.md#-3-unified-deep-linking).
`setSharingFilter` & `setSharingFilterForAllPartners` APIs are deprecated.
Expand All @@ -37,7 +39,7 @@ Instead use the [new API `setSharingFilterForPartners`](https://github.com/AppsF
| stopTracking | stop |
| validateAndTrackInAppPurchase | validateAndLogInAppPurchase |

- From version `6.1.2+4`, we have renated the following APIs:
- From version `6.1.2+4`, we have renamed the following APIs:

|Before v6.1.2+4 | v6.1.2+4 |
|-------------------------------|-----------------------------|
Expand All @@ -46,6 +48,12 @@ Instead use the [new API `setSharingFilterForPartners`](https://github.com/AppsF
### Important notice
- Switch `ConversionData` and `OnAppOpenAttribution` to be based on callbacks instead of streams from plugin version `6.0.5+2`.

## AD_ID permission for Android
In v6.8.0 of the AppsFlyer SDK, we added the normal permission `com.google.android.gms.permission.AD_ID` to the SDK's AndroidManifest,
to allow the SDK to collect the Android Advertising ID on apps targeting API 33.
If your app is targeting children, you need to revoke this permission to comply with Google's Data policy.
You can read more about it [here](https://dev.appsflyer.com/hc/docs/install-android-sdk#the-ad_id-permission).

## 📖 Guides
- [Adding the SDK to your project](/doc/Installation.md)
- [Initializing the SDK](/doc/BasicIntegration.md)
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'com.appsflyer:af-android-sdk:6.5.2'
implementation 'com.appsflyer:af-android-sdk:6.8.0'
implementation 'com.android.installreferrer:installreferrer:2.1'
}
2 changes: 1 addition & 1 deletion android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
package="com.appsflyer.appsflyersdk">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="com.google.android.gms.permission.AD_ID" />
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,6 @@ public void onMethodCall(MethodCall call, Result result) {
case "setAndroidIdData":
setAndroidIdData(call, result);
break;
case "enableLocationCollection":
enableLocationCollection(call, result);
break;
case "setCustomerUserId":
setCustomerUserId(call, result);
break;
Expand Down Expand Up @@ -310,12 +307,21 @@ public void onMethodCall(MethodCall call, Result result) {
case "setResolveDeepLinkURLs":
setResolveDeepLinkURLs(call, result);
break;
case "setDisableNetworkData":
setDisableNetworkData(call, result);
break;
default:
result.notImplemented();
break;
}
}

private void setDisableNetworkData(MethodCall call, Result result) {
boolean disableNetworkData = (boolean) call.arguments;
AppsFlyerLib.getInstance().setDisableNetworkData(disableNetworkData);
result.success(null);
}

private void getOutOfStore(Result result) {
result.success(AppsFlyerLib.getInstance().getOutOfStore(this.mContext));
}
Expand Down Expand Up @@ -646,12 +652,6 @@ private void setCustomerUserId(MethodCall call, Result result) {
result.success(null);
}

private void enableLocationCollection(MethodCall call, Result result) {
boolean flag = (boolean) call.argument("flag");
AppsFlyerLib.getInstance().enableLocationCollection(flag);
result.success(null);
}

private void setAndroidIdData(MethodCall call, Result result) {
String androidId = (String) call.argument("androidId");
AppsFlyerLib.getInstance().setAndroidIdData(androidId);
Expand Down
16 changes: 16 additions & 0 deletions doc/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
- [setResolveDeepLinkURLs](#setResolveDeepLinkURLs)
- [setOutOfStore](#setOutOfStore)
- [getOutOfStore](#getOutOfStore)
- [setDisableNetworkData](#setDisableNetworkData)

---

Expand Down Expand Up @@ -241,6 +242,8 @@ appsFlyerSdk.setAndroidIdData("androidId");
---
**<a id="enableLocationCollection"> `void enableLocationCollection(bool flag)`**

**Removed as of v6.8.0**

_Example:_
```dart
appsFlyerSdk.enableLocationCollection(true);
Expand Down Expand Up @@ -584,3 +587,16 @@ _Example:_
}
```
---
**<a id="setDisableNetworkData"> `void setDisableNetworkData(bool disable)`**

**Android Only!**

Use to opt-out of collecting the network operator name (carrier) and sim operator name from the device.

_Example:_
```dart
if(Platform.isAndroid){
appsflyerSdk.setDisableNetworkData(true);
}
```
---
2 changes: 1 addition & 1 deletion doc/Guides.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ AppsflyerSdk appsflyerSdk = AppsflyerSdk(appsFlyerOptions);

The next step is to call `initSdk` which have the optional boolean parameters `registerConversionDataCallback` and the deeplink callbacks: `registerOnAppOpenAttributionCallback`
`registerOnDeepLinkingCallback`
All callbacks are set to true as default.
All callbacks are set to false as default.

After we call `initSdk` we can use all of AppsFlyer SDK features.

Expand Down
2 changes: 1 addition & 1 deletion example/ios/Flutter/AppFrameworkInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>8.0</string>
<string>9.0</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion example/ios/Flutter/Flutter.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Pod::Spec.new do |s|
s.license = { :type => 'MIT' }
s.author = { 'Flutter Dev Team' => '[email protected]' }
s.source = { :git => 'https://github.com/flutter/engine', :tag => s.version.to_s }
s.ios.deployment_target = '8.0'
s.ios.deployment_target = '9.0'
# Framework linking is handled by Flutter tooling, not CocoaPods.
# Add a placeholder to satisfy `s.dependency 'Flutter'` plugin podspecs.
s.vendored_frameworks = 'path/to/nothing'
Expand Down
21 changes: 9 additions & 12 deletions example/lib/main_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@ class MainPageState extends State<MainPage> {
void initState() {
super.initState();
final AppsFlyerOptions options = AppsFlyerOptions(
afDevKey: DotEnv().env["DEV_KEY"],
appId: DotEnv().env["APP_ID"],
showDebug: true,
timeToWaitForATTUserAuthorization: 15
);
afDevKey: DotEnv().env["DEV_KEY"],
appId: DotEnv().env["APP_ID"],
showDebug: true,
timeToWaitForATTUserAuthorization: 15);
_appsflyerSdk = AppsflyerSdk(options);
_appsflyerSdk.onAppOpenAttribution((res) {
print("onAppOpenAttribution res: " + res.toString());
Expand All @@ -39,10 +38,10 @@ class MainPageState extends State<MainPage> {
_gcd = res;
});
});
_appsflyerSdk.onDeepLinking((DeepLinkResult dp){
_appsflyerSdk.onDeepLinking((DeepLinkResult dp) {
switch (dp.status) {
case Status.FOUND:
print(dp.deepLink?.toString());
print(dp.deepLink?.toString());
print("deep link value: ${dp.deepLink?.deepLinkValue}");
break;
case Status.NOT_FOUND:
Expand Down Expand Up @@ -70,10 +69,9 @@ class MainPageState extends State<MainPage> {
children: <Widget>[
Text('AppsFlyer SDK example app'),
FutureBuilder<String>(
future: _appsflyerSdk.getSDKVersion(),
builder: (BuildContext context, AsyncSnapshot snapshot) {
return Text(snapshot.hasData ? snapshot.data : "");
}),
return Text(snapshot.hasData ? snapshot.data : "");
}),
],
),
),
Expand All @@ -88,7 +86,7 @@ class MainPageState extends State<MainPage> {
} else {
if (snapshot.hasData) {
return HomeContainer(
onData: _gcd,
onData: _gcd,
deepLinkData: _deepLinkData,
logEvent: logEvent,
);
Expand All @@ -102,5 +100,4 @@ class MainPageState extends State<MainPage> {
Future<bool> logEvent(String eventName, Map eventValues) {
return _appsflyerSdk.logEvent(eventName, eventValues);
}

}
4 changes: 2 additions & 2 deletions ios/appsflyer_sdk.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
Pod::Spec.new do |s|
s.name = 'appsflyer_sdk'
s.version = '6.4.4'
s.version = '6.8.0'
s.summary = 'AppsFlyer Integration for Flutter'
s.description = <<-DESC
AppsFlyer is the market leader in mobile advertising attribution & analytics, helping marketers to pinpoint their targeting, optimize their ad spend and boost their ROI.
Expand All @@ -21,6 +21,6 @@ AppsFlyer is the market leader in mobile advertising attribution & analytics, he
s.source_files = 'Classes/**/*'
s.public_header_files = 'Classes/**/*.h'
s.dependency 'Flutter'
s.ios.dependency 'AppsFlyerFramework', '6.5.2'
s.ios.dependency 'AppsFlyerFramework', '6.8.0'

end
Loading

0 comments on commit 5344086

Please sign in to comment.