6. SDK Status Updates

You can stay up to date with changes to the SDK's detection status by setting a status update listener. Status updates are usually triggered by changes to the device state and settings (e.g. airplane mode, location permission, etc). Handling these updates gives you the chance to instruct your user, when applicable, to properly adjust the device setting for optimal SDK detections.

import { addSdkStatusUpdateListener } from '@sentiance-react-native/core';

// Add a listener to start getting notified of SDK status updates, 
// which lets you know if SDK detections are properly running, or if not, then why.
addSdkStatusUpdateListener((sdkStatus) => {
    // Check sdkStatus.detectionStatus to determine whether detections are 
    // running, and if not, check the various status fields to see what 
    // might be blocking the detections.
});

Check this reference page to see the various status fields reported by the SDK.

Last updated