react-native-cellrebelsdk

ReactNative wrapper for CellRebelSDK


Keywords
react-native, ios, android
License
MIT
Install
npm install react-native-cellrebelsdk@1.9.31

Documentation

react-native-cellrebelsdk

ReactNative wrapper for CellRebelSDK

Installation

To install CellRebelSDK run npm install command at the root of your React Native project

npm install react-native-cellrebelsdk

On some versions of ReactNative you might encounter failed to resolve: com.cellrebel.android:cellrebel-sdk error from Gradle, in this case, please add custom Maven repo to your app module build.gradle:

repositories {
  maven {
      url 'https://raw.githubusercontent.com/cellrebel/CellRebelSDK/react-native-support/releases'
  }
}

Usage

In your application entry point import CellRebelSDK module and run init method using your unique CLIENT_KEY string:

import CellRebelSDK from "react-native-cellrebelsdk";

// ...

CellRebelSDK.init(CLIENT_KEY)

Use startTracking to start measurement. On the first launch it's best to call this method after user response on location permission dialog. During the next sessions this method should be called when application finished launching:

CellRebelSDK.startTracking()

In some (rare) cases, if very high load tasks need to be performed, stopTracking can be used to abort an ongoing measurement sequence:

CellRebelSDK.stopTracking()

Call getVersion to retrieve current version of CellRebelSDK:

const sdkVersion = await CellRebelSDK.getVersion()

Use clearUserData if you need to request the removal of user data collected (based on GDPR 'right to be forgotten'):

const result = await CellRebelSDK.clearUserData();

Calling clearUserData will deinitialize CellRebelSDK and remove all local data. init method should be called before using CellRebelSDK again.

Demo project

https://github.com/cellrebel/react-native-cellrebelsdk/tree/master/example