> 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/important-topics/sdk/howto/get-notified-about-location-permissions-changes-or-get-current-location-permission-status.md).

# Check the Location Permissions

To get current location permission status, use the `sdkStatus` property.

{% tabs %}
{% tab title="iOS" %}

```swift
let sdkStatus = Sentiance.shared.sdkStatus

if (sdkStatus.locationPermission == .always) {
    // We are good!
} else {
    // Background location permission not granted.
}

if (sdkStatus.isPreciseLocationAuthorizationGranted) {
    // We are good!
} else {
    // Precise location permission not granted.
}
```

{% endtab %}

{% tab title="Android" %}

<pre class="language-kotlin"><code class="lang-kotlin">val sdkStatus = Sentiance.getInstance(context).sdkStatus

if (sdkStatus.locationPermission == SdkStatus.LocationPermission.ALWAYS) {
    // We are good!
} else {
    // Background location permission not granted.
}

<strong>if (sdkStatus.isPreciseLocationPermGranted) {
</strong>    // We are good!
} else {
    // Precise location permission not granted.
}
</code></pre>

{% endtab %}

{% tab title="React Native" %}

```javascript
import SentianceCore from "@sentiance-react-native/core";

const sdkStatus = await SentianceCore.getSdkStatus();

if (sdkStatus.locationPermission === "ALWAYS") { 
    // We are good!
} else {
    // Background location permission not granted.
}

if (sdkStatus.isPreciseLocationAuthorizationGranted) {
    // We are good!
} else {
    // Precise location permission not granted.
}
```

{% endtab %}

{% tab title="Flutter" %}

```dart
import 'package:sentiance_core/sentiance_core.dart';

final sentiance = SentianceCore();
final sdkStatus = await sentiance.getSdkStatus();

if (sdkStatus.locationPermission == LocationPermission.always) {
    // We are good!
} else {
    // Background location permission not granted.
}
```

{% endtab %}
{% endtabs %}

In the above example, `sdkStatus` returns an SDK status object ([iOS](/important-topics/sdk/api-reference/ios/sentsdkstatus.md) / [Android](/important-topics/sdk/api-reference/android/sdkstatus.md)) which has properties for the location permission and precision.

{% hint style="info" %}
The user must grant the background location access permission in order for SDK detections to work. This is presented as the "**always**" option on iOS, and the "**allow all the time**" option on Android 10+ devices.

The user must also enable precise location accuracy.
{% endhint %}

To be notified of location permission changes, you can set up an SDK status listener on the SDK's config object as follows:

{% tabs %}
{% tab title="iOS" %}

```swift
Sentiance.shared.setDidReceiveSdkStatusUpdateHandler { status in
    // Check the location permission and precision here.
}
```

{% endtab %}

{% tab title="Android" %}

```kotlin
Sentiance.getInstance(this).setSdkStatusUpdateListener { status -> 
    // Check the location permission and precision here.
}
```

{% endtab %}

{% tab title="React Native" %}

```javascript
import SentianceCore from "@sentiance-react-native/core";

const subscription = await SentianceCore.addSdkStatusUpdateListener(
    sdkStatus => {
        // Check the location permission and precision here.
    }
);
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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/important-topics/sdk/howto/get-notified-about-location-permissions-changes-or-get-current-location-permission-status.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.
