GithubHelp home page GithubHelp logo

isabella232 / appsflyer-react-native-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from appsflyersdk/appsflyer-react-native-plugin

0.0 0.0 0.0 8.71 MB

AppsFlyer plugin for React Native

License: MIT License

Java 33.51% JavaScript 22.42% Objective-C 41.55% Ruby 0.96% Starlark 1.37% Shell 0.19%

appsflyer-react-native-plugin'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 License: MIT Downloads

Table of content

This plugin is built for

  • iOS AppsFlyerSDK v6.1.3
  • Android AppsFlyerSDK v6.1.3

โ— 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
AppsFlyerTracker AppsFlyerLib

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 --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.

๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ Add or Remove Strict mode for App-kids

Starting from version 6.1.10 iOS SDK comes in two variants: Strict mode and Regular mode. Please read more here

Change to Strict mode
After you installed the AppsFlyer plugin, go to the react-native-appsflyer folder inside the node_modules folder:

cd node_modules/react-native-appsflyer

Run the script changeMode.sh strict

./changeMode.sh strict

Go to the ios folder in your root project

cd ../../ios

Run pod install

Change to Regular mode
Go to the react-native-appsflyer folder inside the node_modules folder:

cd node_modules/react-native-appsflyer

Run the script changeMode.sh (WITHOUT strict)

./changeMode.sh

Go to the ios folder in your root project

cd ../../ios

Run pod install

๐Ÿš€ 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, //Optional
    onDeepLinkListener: true, //Optional
  },
  (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)
onDeepLinkListener Set listener for DDL response (Optional. default=false)

๐Ÿ“– Guides

Great installation and setup guides can be viewed here.

๐Ÿ“‘ API

See the full API available for this plugin.

appsflyer-react-native-plugin's People

Contributors

af-fess avatar af-margot avatar amit-kremer93 avatar bang9 avatar benjaminaf avatar drop-george avatar gabecoyne avatar haveamission avatar idanlevi1 avatar ifsnow avatar jsdario avatar kurtsergey avatar leethree avatar mrkriegler avatar newtonry avatar screamz avatar shachar-af avatar shaharaf avatar shoken0x avatar sokoloff06 avatar sonicdoe avatar tamago3keran avatar wesfieldj avatar willcaul avatar zidail avatar

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.