Skip to content

mifi/appsflyer-react-native-plugin

 
 

Repository files navigation

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.

npm version

Table of content

  • iOS AppsFlyerSDK v5.2.0
  • Android AppsFlyerSDK v5.2.0
$ npm install react-native-appsflyer --save

Then run the following:

iOS

$ cd ios && pod install
$ react-native run-ios

Android

$ react-native run-android

Starting from RN v0.60, and react-native-appsflyer v1.4.7 the plugin uses autolinking.
If your app does not support autolinking, check out the Installation Guide here.

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',
  },
  (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

Important - For iOS another step is required. AppState logic is required to record Background-to-foreground transitions. Check out the relevant guide to see how this mandatory step is implemented.

Great installation and setup guides can be viewed here.

See the full API available for this plugin.

About

AppsFlyer plugin for React Native

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 49.0%
  • Java 37.5%
  • JavaScript 12.8%
  • Ruby 0.7%