$ npm install react-native-appsflyer --save
- Add the
appsFlyerFramework
topodfile
and runpod install
.
Example:
pod 'react-native-appsflyer',
:path => '../node_modules/react-native-appsflyer'
This assumes your Podfile
is located in ios
directory.
You must also have the React dependencies defined in the Podfile as described here.
target 'AFTest' do
pod 'React', :path => '../node_modules/react-native', :subspecs => [
'Core',
'CxxBridge', # Include this for RN >= 0.47
'DevSupport', # Include this to enable In-App Devmenu if RN >= 0.43
'RCTText',
'RCTNetwork',
'RCTWebSocket', # Needed for debugging
'RCTAnimation', # Needed for FlatList and animations running on native UI thread
# Add any other subspecs you want to use in your project
]
pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
pod 'react-native-appsflyer',
:path => '../node_modules/react-native-appsflyer'
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
end
- Run
pod install
(insideios
directory).
- Download the Static Lib of the AppsFlyer iOS SDK from here: https://support.appsflyer.com/hc/en-us/articles/207032066-AppsFlyer-SDK-Integration-iOS#2-quick-start
- Unzip and copy the contents of the Zip file into your project directory
- Run
react-native link react-native-appsflyer
from of the project root or copy RNAppsFlyer.h and RNAppsFlyer.m fromnode_modules
➜react-native-appsflyer
to your project directory
Run react-native link react-native-appsflyer
OR add manually:
Add the project to your dependencies
dependencies {
...
compile project(':react-native-appsflyer')
}
Add the project
include ':react-native-appsflyer'
project(':react-native-appsflyer').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-appsflyer/android')
If you need to override sdk version, add custom configuration to your root gradle, for example:
ext {
minSdkVersion = 16
targetSdkVersion = 25
compileSdkVersion = 25
buildToolsVersion = '25.0.3'
}
Add:
-
import com.appsflyer.reactnative.RNAppsFlyerPackage;
-
In the
getPackages()
method register the module:new RNAppsFlyerPackage()
So getPackages()
should look like:
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
//...
new RNAppsFlyerPackage()
//...
);
}