Giter VIP home page Giter VIP logo

react-native-appsflyer's Introduction

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 [email protected]

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 v4.8.12
  • Android AppsFlyerSDK v4.8.20
$ npm install react-native-appsflyer --save

Then run:

$ react-native link react-native-appsflyer

With Cocoapods

Add the appsFlyerFramework to podfile and run pod install.

pod 'react-native-appsflyer',
:path => '../node_modules/react-native-appsflyer'

Note that You must also have the React dependencies defined in the Podfile as described here.

Check out the sample pod file for a working example.

Without Cocoapods

  1. Download the Static Lib of the AppsFlyer iOS SDK from here.
  2. Unzip and copy the contents of the Zip file into your project directory.
  3. Copy RNAppsFlyer.h and RNAppsFlyer.m from node_modules โžœ react-native-appsflyer to your project directory.

For more info check out the Installation guide here.

Running react-native link react-native-appsflyer will complete the Android integration.

For the manual integration steps, check out the Installation guide here.

Set your App_ID (iOS only), Dev_Key and enable AppsFlyer to detect installations, sessions (app opens) and updates.

This is the minimum requirement to start tracking your app installs and is already implemented in this plugin. You MUST modify this call and provide:
devKey - Your application devKey provided by AppsFlyer.
appId - For iOS only. Your iTunes Application ID.

Add the following lines to your code to be able to initialize tracking with your own AppsFlyer dev key:

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);
  }
)

Important - For iOS another step is required for tracking. AppState logic is required to track Background-to-foreground transitions. Check out the relevant guide to see how this manidtory step is impelemented.

Great installation and setup guides can be viewed here.

See the full API available for this plugin.

Check out the demo for this project here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.