> For the complete documentation index, see [llms.txt](https://docs.sentiance.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sentiance.com/sdk/appendix/sdk-status.md).

# SDK Status

Learn what each SDK status field means, and how to use them to find out why detections are blocked.

The SDK status describes whether the Sentiance SDK is able to perform detections, and if it is not, what is preventing it. Every field reflects the current state of the device, the user, and your app's permissions.

To retrieve the status, or to subscribe for updates when it changes, check out [SDK Status Updates](/getting-started/sdk-integration/6.-sdk-status-updates.md).

***

## Detection Status

This is the field to check first. The other fields explain how it got its value.

<table><thead><tr><th width="270">Value</th><th>Meaning</th></tr></thead><tbody><tr><td><code>ENABLED_AND_DETECTING</code></td><td>Detections are enabled and running. Nothing is blocking the SDK.</td></tr><tr><td><code>ENABLED_BUT_BLOCKED</code></td><td>Detections are enabled, but something on the device is preventing them. Check the fields below to find out what.</td></tr><tr><td><code>DISABLED</code></td><td>Detections have not been enabled. Call <code>enableDetections()</code>.</td></tr><tr><td><code>EXPIRED</code></td><td>Detections were enabled with an expiry date that has passed. Call <code>enableDetections()</code> again.</td></tr></tbody></table>

{% hint style="info" %}
A status of `ENABLED_AND_DETECTING` means the SDK is able to detect, not that a transport is currently in progress. The SDK detects when the user starts moving.
{% endhint %}

***

## Permissions and Device Settings

These fields report the conditions that most commonly block detections. The **Blocks detections** column indicates whether the SDK stops detecting when the condition is not met.

<table><thead><tr><th width="300">Field</th><th width="85">Platform</th><th width="110">Blocks detections</th><th>Meaning</th></tr></thead><tbody><tr><td><code>locationPermission</code></td><td>iOS, Android</td><td>Yes</td><td><code>ALWAYS</code>, <code>ONLY_WHILE_IN_USE</code> or <code>NEVER</code>. Must be <code>ALWAYS</code> for detections to run.</td></tr><tr><td><code>isPreciseLocationAuthorizationGranted</code></td><td>iOS, Android</td><td>Yes</td><td>False when the user granted approximate location only. Detections require precise location.</td></tr><tr><td><code>isLocationAvailable</code></td><td>iOS, Android</td><td>Yes</td><td>False when location services are turned off device-wide.</td></tr><tr><td><code>locationSetting</code></td><td>Android</td><td>Yes</td><td><code>OK</code>, <code>BATTERY_SAVING</code>, <code>DEVICE_ONLY</code> or <code>DISABLED</code>. Anything other than <code>OK</code> reduces or prevents detections.</td></tr><tr><td><code>isAirplaneModeEnabled</code></td><td>Android</td><td>Yes</td><td>True while the device is in airplane mode.</td></tr><tr><td><code>isActivityRecognitionPermGranted</code></td><td>iOS, Android</td><td>No</td><td>Motion &#x26; Fitness on iOS, Activity Recognition on Android. Optional, but improves detection quality.</td></tr><tr><td><code>backgroundRefreshStatus</code></td><td>iOS</td><td>No</td><td><code>AVAILABLE</code>, <code>DENIED</code> or <code>RESTRICTED</code>. Reports whether Background App Refresh is available to your app.</td></tr></tbody></table>

{% hint style="warning" %}
**Permissions can be revoked at any time**

A user can withdraw a permission from the system settings while your app is running, and the operating system may reset permissions for apps that have been unused for a while. Subscribe for SDK status updates rather than checking the status once at startup.
{% endhint %}

For guidance on requesting these permissions, check out [this page](/important-topics/app-permissions.md).

***

## Battery and Background Restrictions

Detections depend on the SDK being allowed to run in the background. These fields report the restrictions that affect it.

<table><thead><tr><th width="300">Field</th><th width="85">Platform</th><th width="110">Blocks detections</th><th>Meaning</th></tr></thead><tbody><tr><td><code>isBackgroundProcessingRestricted</code></td><td>Android</td><td>Yes</td><td>True when the user has restricted background activity for your app.</td></tr><tr><td><code>isBatterySavingEnabled</code></td><td>iOS, Android</td><td>No</td><td>True while the device is in a power saving mode, which limits background work.</td></tr><tr><td><code>isBatteryOptimizationEnabled</code></td><td>Android</td><td>No</td><td>True when your app is subject to battery optimization. Check out <a href="/sdk/appendix/battery-optimization.md">this page</a> for the implications.</td></tr><tr><td><code>isSchedulingExactAlarmsPermitted</code></td><td>Android</td><td>No</td><td>Whether your app may schedule exact alarms. Not required, but when permitted it improves the timeliness of the SDK's background work.</td></tr></tbody></table>

***

## Hardware and Platform Requirements

<table><thead><tr><th width="300">Field</th><th width="85">Platform</th><th width="110">Blocks detections</th><th>Meaning</th></tr></thead><tbody><tr><td><code>isGooglePlayServicesMissing</code></td><td>Android</td><td>Yes</td><td>True when Google Play Services is unavailable. The SDK relies on it for Fused Location and Geofencing.</td></tr><tr><td><code>isGyroPresent</code></td><td>iOS, Android</td><td>No</td><td>Whether a gyroscope is present on the device. Optional, but when present it improves detection quality.</td></tr><tr><td><code>isAccelPresent</code></td><td>iOS, Android</td><td></td><td>Whether an accelerometer is present on the device.</td></tr><tr><td><code>isGpsPresent</code></td><td>iOS, Android</td><td></td><td>Whether GPS hardware is present on the device.</td></tr><tr><td><code>canMonitorGeofences</code></td><td>iOS, Android</td><td></td><td>Whether the SDK is able to monitor geofences. Both platforms limit how many an app may set, as described on the <a href="/getting-started/sdk-integration/1.-requirements/android.md#runtime">Android</a> and <a href="/getting-started/sdk-integration/1.-requirements/ios.md#runtime">iOS</a> requirements pages.</td></tr></tbody></table>

***

## SDK and User State

<table><thead><tr><th width="300">Field</th><th width="85">Platform</th><th width="110">Blocks detections</th><th>Meaning</th></tr></thead><tbody><tr><td><code>isRemoteEnabled</code></td><td>iOS, Android</td><td>Yes</td><td>False when detections have been disabled remotely for this app or user. Contact Sentiance if this is unexpected.</td></tr><tr><td><code>userExists</code></td><td>iOS, Android</td><td>Yes</td><td>Whether a Sentiance user exists on this device. Check out <a href="/sdk/appendix/user-creation-and-management.md">this page</a> for details.</td></tr><tr><td><code>canDetect</code></td><td>iOS, Android</td><td></td><td>Whether the SDK is currently able to perform detections.</td></tr><tr><td><code>startStatus</code></td><td>iOS, Android</td><td></td><td><strong>Deprecated.</strong> Use <code>detectionStatus</code> instead.</td></tr></tbody></table>

{% hint style="warning" %}
**`startStatus` is deprecated**

Use <mark style="color:$success;">**`detectionStatus`**</mark> to determine whether the SDK is detecting. New integrations should not read `startStatus`.
{% endhint %}

***

## Data Quotas

The SDK operates within quotas for the data it transmits and stores. Each field is `OK`, `WARNING` or `EXCEEDED`.

<table><thead><tr><th width="300">Field</th><th width="85">Platform</th><th width="110">Blocks detections</th><th>Meaning</th></tr></thead><tbody><tr><td><code>diskQuotaStatus</code></td><td>iOS, Android</td><td>Yes</td><td>Data stored on the device, pending transmission. Detections stop while this quota is exceeded.</td></tr><tr><td><code>wifiQuotaStatus</code></td><td>iOS, Android</td><td>No</td><td>Data transmitted over Wi-Fi.</td></tr><tr><td><code>mobileQuotaStatus</code></td><td>iOS, Android</td><td>No</td><td>Data transmitted over the mobile network.</td></tr></tbody></table>

{% hint style="warning" %}
**An exceeded disk quota blocks detections**

When the transmission quotas are exceeded, the SDK continues to detect and holds the data until the quota resets. An exceeded disk quota is different: there is nowhere left to store new data, so detections stop. For more about how the SDK synchronizes data, check out [this page](/sdk/appendix/data-sychronization.md).
{% endhint %}

***

## Diagnosing Blocked Detections

When the detection status is `ENABLED_BUT_BLOCKED`, check the fields marked as blockers above. The most common causes are:

* Background location permission is not `ALWAYS`.
* Precise location is not granted.
* Location services are disabled on the device.
* Background activity is restricted for your app, on Android.
* Google Play Services is missing, on Android.
* The disk quota is exceeded.

{% hint style="success" %}
Surface these conditions in your own app. The SDK reports them so that you can guide the user to the setting that needs changing, which is the most effective way to keep detections running.
{% endhint %}

***

Check out [SDK Status Updates](/getting-started/sdk-integration/6.-sdk-status-updates.md) to subscribe for changes to these fields.
