1. Add the following xml to your config.xml
in the root directory of your www
folder:
<feature name="AppsFlyerPlugin">
<param name="ios-package" value="AppsFlyerPlugin" />
</feature>
<feature name="AppsFlyerPlugin">
<param name="android-package" value="com.appsflyer.cordova.plugin.AppsFlyerPlugin" />
</feature>
2. For Android, add the following xml to your AndroidManifest.xml
:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
3. Copy appsflyer.js to www/js/plugins
and reference it in index.html
:
<script type="text/javascript" src="js/plugins/appsflyer.js"></script>
4. Download the source files and copy them to your project.
Open in Xcode AppDelegate.m
, add #import "AppsFlyerTracker.h"
and add the following method under application: openURL
:
[[AppsFlyerTracker sharedTracker] handleOpenURL:url sourceApplication:sourceApplication withAnnotation:annotation];
It appears as follows:
-(BOOL) application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
[[AppsFlyerTracker sharedTracker] handleOpenURL:url sourceApplication:sourceApplication withAnnotation:annotation];
return YES;
}
##Demo
This plugin has a examples
folder with demoA
(Angular 1) project bundled with it. To give it a try , clone this repo and from root a.e. cordova-plugin-appsflyer-sdk
execute the following:
npm run setup
npm run demo.ra
- runs Androidnpm run demo.ba
- builds Androidnpm run demo.ri
- runs iOSnpm run demo.bi
- builds iOS