$ npm install react-native-apps-flyer --save
- In XCode, in the project navigator, right click
Libraries
➜Add Files to [your project's name]
- Go to
node_modules
➜react-native-apps-flyer
and addRNAppsFlyer.xcodeproj
- In XCode, in the project navigator, select your project. Add
libRNAppsFlyer.a
to your project'sBuild Phases
➜Link Binary With Libraries
- Install the appsFlyerFramework pod file from their website. Uncomment
use_frameworks!
in the Podfile. - Run your project (
Cmd+R
)<
- In your MainApplication.java import
import com.ppsreejith.RNAppsFlyerPackage;
- If you use an anonymous ReactNativeHost class create a field like this inside
private final Application application = MainApplication.this;
- In the
getPackages()
method register the modulenew RNAppsFlyerPackage(application)
- Add the project to your build.gradle dependencies
compile project(':react-native-apps-flyer')
- Add the project to your settings.gradle
include ':react-native-apps-flyer
project(':react-native-apps-flyer').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-apps-flyer/android')
import af from 'react-native-apps-flyer';
//To Initialize sdk using appId and devKey
af.init(appId, devKey, function(err, events) {
//events is [appId, devKey] for now
//To trigger an event,
af.sendTrackingWithEvent(eventName, {key1: value1, key2: value2}, function(err, events) {
//events is {key1: value1, key2, value2}
});
// To get appsFlyerUID an event,
af.getAppsFlyerUID(function(err, uid) {
});
// To track location with lat and long * note lat and long should be floats only,
af.trackLocation(last, long, function(err, data) {
});
})
The android module currently does not support callbacks and event values
import af from 'react-native-apps-flyer';
//To Initialize sdk using appId and devKey
af.init(appId, devKey);
af.sendTrackingWithEvent(eventName);