react-native-mobigate

1.0.5 • Public • Published

React Native Mobigate SDK plugin for Android

MobigateSDK is a tool for gathering users phone data and events tracking.

Overview

Library version Platforms

Plugin installation

yarn add react-native-mobigate

or

npm install react-native-mobigate --save

React Native >= 0.60

Starting from React Native 0.60, autolinking makes the installation process simpler

React Native <= 0.59

Mostly automatic installation:

react-native link react-native-mobigate

Manual installation:

Manually link the library on Android
  1. Add to: android/settings.gradle
include ':react-native-mobigate'
project(':react-native-mobigate').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-mobigate/android')
  1. Add to: android/app/build.gradle
dependencies {
implementation project(':react-native-mobigate')
}
  1. Add the MobigatePackage class to your list of exported packages into: android/app/src/main/.../MainApplication.java
...
import pl.spicymobile.reactmobigate.MobigatePackage;
   
   
@Override
protected List<ReactPackage> getPackages() {
    return Arrays.<ReactPackage>asList(
        new MainReactPackage(), 
        new MobigatePackage()
    );
}

SDK Initialization

Initialize SDK first

if (Platform.OS === 'android') {
    Mobigate.init("V0K6jhiIfem6CRWHYZ59Nmj3oFBBKbJsnSsWfR2JNq7ktblOUXwbJoBQTpWnw2uSwW76gpiu2kun50jweTY69B",
        {}, 
    (initSuccess) => {
          console.log(initSuccess)
        }, 
    (initError) => {
          console.log(initError)
        })
    }

Start gather data

Mobigate.startSDK((result) => {
            console.log(result)
          }, (errorResult) => {
            console.log(errorResult)
          })

Guides

Full installation and setup guides can be viewed here.

Package Sidebar

Install

npm i react-native-mobigate

Weekly Downloads

0

Version

1.0.5

License

MIT

Unpacked Size

68.3 kB

Total Files

27

Last publish

Collaborators

  • spicymobile