Examples
Install the module
npm i @sentiance-react-native/legacyImport the module
import RNSentiance from "@sentiance-react-native/legacy";Initialize the SDK and create a user
Without User Linking
const shouldStart = true; // start the SDK too
// returns Promise<boolean | SdkStatus>
const result = await RNSentiance.init(appId, secret, baseUrl, shouldStart);With User Linking
const emitter = new NativeEventEmitter(RNSentiance);
emitter.addListener('SDKUserLink',
async data => {
const { installId } = data;
const success = await linkUserToYourBackend(installId);
RNSentiance.userLinkCallback(success);
}
);
const shouldStart = true; // start the SDK too
// returns Promise<boolean | SdkStatus>
const result = await RNSentiance.initWithUserLinkingEnabled(
appId, secret, baseUrl, shouldStart);Starting the SDK
Stopping the SDK
Init status
SDK status
Get the SDK version
Get the user ID
Get the user access token
Adding custom metadata
Remove custom metadata
Adding multiple custom metadata fields
Starting trip
Stopping trip
Trip status
Control sending data
Disk, mobile network and Wi-Fi quotas
User Activity
Update the SDK foreground notification (ANDROID ONLY)
Resetting the SDK
Vehicle Crash Event Detection
Invoke a dummy vehicle crash event
Check if crash detection is supported
Disable battery optimization (Android)
Last updated