React native integration

Version 5.5 by Developer on 2020/01/02 13:40

Overview

The plugin is located at npmjs repositories (npm repositories)
This plugin is built for:

  • Mobigate SDK version 1.0.4

Adding SDK to the project

First, install library from the repository with

yarn add react-native-mobigate

or

npm install react-native-mobigate --save

Link newly added plugin

  • 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:

Api methods

To use any method from the plugin add import:

import Mobigate from 'react-native-mobigate'

SDK initialization

You must initialize the library before running it. Use init(apiKey, options, onSuccess, onError) method for that:

Mobigate.init(apiKey, options, onSuccess, onError)

ParameterTypeDescription
apiKeyStringApi key provided by your business partner
optionsJson ObjectSDK configuration 
onSuccessFunctionreturns callback object
onErrorFunctionreturns callback object

Options

NameTypeDefaultDescription
 appIdentifierString  Application identifier
appInstallationSource String  App installation source e.g., google-play, organic.
email String   Set's user email.
customUserId String   Set custom User Agent.
 enableUserFieldsJson Array   Enable custom fields in user data. By default MobienceSDK is gathering all identifiers, which it can read. You can choose one of these field: ["email", "imei", "imsi", "msisdn", "mac", "serial"] DODAĆ LINKA DO CONSTANTS.
 dataGatherPolicy Json Object  Enable custom data gater policy. By default MobienceSDK gather all data it can read and hide notification icon. Check below DataGatherPolicy options for more details.
 enableIdProfilesBoolean false  turns on / off the IDs profiles system.

DataGatherPolicy options

NameTypeDefaultDescription
 monitorStateString  Application identifier
notificationTextString  if state = "DEFAULT" you can pass custom foreground service notification text

Tracking in app events

Remaining methods

NameTypeDefaultDescription
    

Constants

Sample app

Tags:
Created by Admin on 2019/12/30 10:45
Spicy Mobile
spicymobile.pl