# 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.

To get SDK status updates in the background, add the code the below inside your app's `index.js` file:

```javascript
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.
});
```

If you're only interested in such updates when the app is in the foreground, then place this code inside your UI code.

Check [this](https://github.com/sentiance/react-native-sentiance/blob/main/packages/core/lib/index.d.ts) reference page to see the various status fields reported by the SDK.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sentiance.com/a-complete-integration/react-native-quick-start/6.-sdk-status-updates.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
