GithubHelp home page GithubHelp logo

tagipedia / react-native-adjust-sdk Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dbasedow/react-native-adjust-sdk

0.0 3.0 0.0 12 KB

react-native integration of the Adjust SDK

License: MIT License

Objective-C 31.62% Java 49.17% JavaScript 19.21%

react-native-adjust-sdk's Introduction

Installation Android

  1. npm install https://github.com/dbasedow/react-native-adjust-sdk.git --save
  2. rnpm link
  3. open your project's MainActivity.java and add ReactNativeAdjustSdk to the list in the getPackages method:
    protected List<ReactPackage> getPackages() {
        return Arrays.<ReactPackage>asList(
                new MainReactPackage(), new ReactNativeAdjustSdk());
    }
  1. add permission to your apps manifest
<uses-permission android:name="android.permission.INTERNET" />
  1. add INSTALL_REFERRER receiver (very important, without it install attributions will not work)
<receiver android:name="com.adjust.sdk.AdjustReferrerReceiver" android:exported="true">
        <intent-filter>
            <action android:name="com.android.vending.INSTALL_REFERRER" />
        </intent-filter>
</receiver>

If you use proguard check the official docs: https://github.com/adjust/android_sdk

Installation iOS

  1. npm install https://github.com/dbasedow/react-native-adjust-sdk.git --save
  2. rnpm link
  3. go to https://github.com/adjust/ios_sdk/releases and download the most up to date AdjustSdkStatic.framework.zip (the static part is important, otherwise you have to change your Deployment Target from 7 to 8)
  4. open your project in XCode
  5. unzip the framework and open in Finder
  6. drag AdjustSdk.framework into your XCode project

Tracking Installs

Add this to your JavaScript code:

import {Adjust, AdjustEnvironmentSandbox} from 'ReactNativeAdjustSdk';
Adjust.init({appToken: 'YOURAPPTOKEN', environment: AdjustEnvironmentSandbox});

Tracking Events

Adjust.trackEvent({token: 'EVENTTOKEN'});

The earlier you put it in the code the better. Before the initialization no events/installs are sent to Adjust.

Important: You have to switch from AdjustEnvironmentSandbox to AdjustEnvironmentProduction when releasing your app to production (the log output will remind you).

react-native-adjust-sdk's People

Contributors

dbasedow avatar shimaa-hassan avatar

Watchers

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