Major changes have been made to the new version of the Android SDK integration.
The main changes are:
- The SDK is now a singleton, meaning that every call to the APIs should be called as follows:
- SetAppsFlyerKey()– this method was removed and as a result we expect to receive the dev key using the new init method.: i.e. AppsFlyerLib.getInstance().startTracking (this,"YOUR_APPSFLYER_DEV_KEY");
- sendTracking(), onActivityPause(), onActivityResume()were removed. The SDK detects launches automatically.
- Deeplink - for activities that support deeplinking the developer should call:
AppsFlyerLib.getInstance().sendDeepLinkData(this) from the onCreate()
of the displayed activity.
This is necessary only if the app is not running in the background.
- Logging - The logging flag default value has been changed to false. In addition, if the flag is turned off, no logs are printed (bug fix). To activate logging flag, the developer should call:
To view the AppsFlyer SDK Integration Guide for Android, click here.
Migrating to 4.4.0 and Higher
AppsFlyer's Android SDK v4.4.0 no longer supports the following receiver in the manifest:
<receiver android:name="com.appsflyer.AppsFlyerLib"> <intent-filter> <action android:name="android.intent.action.PACKAGE_REMOVED"/> <data android:scheme="package"/> </intent-filter> </receiver>
If you are using any version equal or higher than 4.4.0, Please remove this receiver from your manifest file.
The only mandatory receiver for the SDK is as follows:
<receiver android:name="com.appsflyer.MultipleInstallBroadcastReceiver" android:exported="true"> <intent-filter> <action android:name="com.android.vending.INSTALL_REFERRER" /> </intent-filter> </receiver>