Package Exports
- react-native-appsflyer
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-native-appsflyer) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
React Native AppsFlyer plugin for Android and iOS.
🛠 In order for us to provide optimal support, we would kindly ask you to submit any issues to support@appsflyer.com
When submitting an issue please specify your AppsFlyer sign-up (account) email , your app ID , production steps, logs, code snippets and any additional relevant information.
Table of content
This plugin is built for
- iOS AppsFlyerSDK v6.1.0
- Android AppsFlyerSDK v6.1.0
❗ v6 Breaking Changes
We have renamed the following APIs:
| Old API | New API |
|---|---|
| trackEvent | logEvent |
| trackLocation | logLocation |
| stopTracking | stop |
| trackCrossPromotionImpression | logCrossPromotionImpression |
| trackAndOpenStore | logCrossPromotionAndOpenStore |
| setDeviceTrackingDisabled | anonymizeUser |
And removed the following ones:
- trackAppLaunch -> no longer needed. See new init guide
- sendDeepLinkData -> no longer needed. See new init guide
- enableUninstallTracking -> no longer needed. See new uninstall measurement guide
If you have used 1 of the removed APIs, please check the integration guide for the updated instructions
📲 Adding the SDK to your project
Production version from npm:
$ npm install react-native-appsflyer --saveThen run the following:
iOS
$ cd ios && pod install
$ react-native run-iosAndroid
$ react-native run-androidStarting from RN v0.60, and react-native-appsflyer
v1.4.7the plugin uses autolinking.
If your app does not support autolinking, check out the Installation Guide here.
🚀 Initializing the SDK
Initialize the SDK to enable AppsFlyer to detect installations, sessions (app opens) and updates.
import React, {Component} from 'react';
import {Platform, StyleSheet, Text, View} from 'react-native';
import appsFlyer from 'react-native-appsflyer';
appsFlyer.initSdk(
{
devKey: 'K2***********99',
isDebug: false,
appId: '41*****44',
onInstallConversionDataListener: true,
},
(result) => {
console.log(result);
},
(error) => {
console.error(error);
}
);| Setting | Description |
|---|---|
| devKey | Your application devKey provided by AppsFlyer (required) |
| appId | Your iTunes application ID (iOS only) |
| isDebug | Debug mode - set to true for testing only |
| onInstallConversionDataListener | Set listener for SDK init response (Optional. default=true) |
📖 Guides
Great installation and setup guides can be viewed here.
📑 API
See the full API available for this plugin.