> For the complete documentation index, see [llms.txt](https://dev.pointr.tech/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dev.pointr.tech/features/indoor-location-blue-dot/operating-system-permissions.md).

# Operating System Permissions

Learn how to control, customize, and suppress permission requests in the Pointr SDK, on both Android and iOS.

The Pointr SDK automatically manages runtime permissions required for positioning, geofencing, and notifications. You can override this behavior to suppress specific permission dialogs or handle permissions entirely within your host application. The mechanism for overriding differs by platform: Android exposes plain settable properties on `PermissionManager`, while iOS uses a delegate protocol (`PTRPermissionManagerDelegate`).

## Managed Permissions

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

| Permission / Service                               | Android Version    | Flag                                           | Default |
| -------------------------------------------------- | ------------------ | ---------------------------------------------- | ------- |
| Fine Location (`ACCESS_FINE_LOCATION`)             | All                | `shouldRequestLocationPermissionForWhileInUse` | `true`  |
| Background Location (`ACCESS_BACKGROUND_LOCATION`) | Q+ (API 29)        | `shouldRequestLocationPermissionForAlways`     | `true`  |
| Location Service                                   | All                | `shouldRequestLocationService`                 | `true`  |
| Bluetooth Scan (`BLUETOOTH_SCAN`)                  | S+ (API 31)        | `shouldRequestBluetoothPermission`             | `true`  |
| Bluetooth Service                                  | All                | `shouldRequestBluetoothService`                | `true`  |
| Notifications (`POST_NOTIFICATIONS`)               | Tiramisu+ (API 33) | `shouldRequestNotificationPermission`          | `true`  |
| {% endtab %}                                       |                    |                                                |         |

{% tab title="iOS" %}

| Permission / Service                       | iOS Version | Info.plist Key                                 | Flag (delegate function)                                   |
| ------------------------------------------ | ----------- | ---------------------------------------------- | ---------------------------------------------------------- |
| Location, When In Use                      | All         | `NSLocationWhenInUseUsageDescription`          | `shouldRequestLocationAuthorizationPermissionForWhenInUse` |
| Location, Always                           | All         | `NSLocationAlwaysAndWhenInUseUsageDescription` | `shouldRequestLocationAuthorizationPermissionForAlways`    |
| Notifications (`UNUserNotificationCenter`) | All         | —                                              | `shouldRequestNotificationPermission`                      |
| Core Motion                                | iOS 17+     | `NSMotionUsageDescription`                     | `shouldRequestCoreMotionAuthorizationPermission`           |
| {% endtab %}                               |             |                                                |                                                            |
| {% endtabs %}                              |             |                                                |                                                            |

When not explicitly set/overridden, the SDK determines whether to request each permission based on the server-side configuration (see [Configuration-Based Behavior](#configuration-based-behavior)).

{% hint style="warning" %}
**Platform gap — confirmed, not a doc omission:** iOS does not manage Bluetooth permission or service state at all — there's no table row, flow step, or delegate function for it on iOS, even though beacon positioning uses Bluetooth on both platforms. This is genuine SDK behavior, not a missing section in this doc.
{% endhint %}

{% hint style="info" %}
On iOS, the corresponding `NS*UsageDescription` keys must be present in your app's `Info.plist`, or the OS will silently refuse to show the prompt (and may terminate the app when the permission is invoked). The SDK cannot add these keys for you. Android has no equivalent runtime requirement beyond the standard `AndroidManifest.xml` permission declarations.
{% endhint %}

## Managing Manifest Permissions

The Android Pointr SDK includes certain permissions in its Manifest file by default. When an integrator includes Pointr SDK in their app, these permissions are automatically included in the application's Android Manifest file, viewable from the 'Merged Manifest' tab on Android Studio.&#x20;

The Manifest permissions that are related to positioning are listed below;

<table><thead><tr><th width="300.1328125">Manifest Permission</th><th>Functionality</th><th>Min API</th><th>Max API</th></tr></thead><tbody><tr><td>BLUETOOTH</td><td>Request bluetooth permission</td><td>N/A</td><td>30</td></tr><tr><td>BLUETOOTH_ADMIN</td><td>Request bluetooth permission</td><td>N/A</td><td>30</td></tr><tr><td>BLUETOOTH_SCAN</td><td>Required to start BLE scan</td><td>31</td><td>N/A</td></tr><tr><td>BLUETOOTH_CONNECT</td><td>Required to toggle BLE on/off</td><td>31</td><td>N/A</td></tr><tr><td>ACCESS_COARSE_LOCATION</td><td>Required to access user's coarse location</td><td>N/A</td><td>N/A</td></tr><tr><td>ACCESS_FINE_LOCATION</td><td>Required to access user's fine location. Also required to derive location data from beacon scans</td><td>N/A</td><td>N/A</td></tr><tr><td>ACCESS_BACKGROUND_LOCATION</td><td>Required to access user position while the app is in the background</td><td>29</td><td>N/A</td></tr><tr><td>FOREGROUND_SERVICE</td><td>Required to start a foreground service which is necessary for background position tracking</td><td>28</td><td>N/A</td></tr><tr><td>FOREGROUND_SERVICE_LOCATION</td><td>Foreground service type requires declaration to be started. In order to use background position tracking this should be present.</td><td>34</td><td>N/A</td></tr></tbody></table>

If your app does not utilize the functionality associated with any of the permissions below, you can remove them from your application's manifest file by adding the following line and replacing the permission name with the name of the permission you would like to remove;

```
    <uses-permission android:name="<insert-permission-name-to-remove" tools:node="remove" />
```

You can verify the permission is successfully removed by checking the 'Merged Manifest' section from Android Studio.

{% hint style="info" %}
When submitting your app to Play Store, the Background Location permission and the Foreground Service permissions require specific use case declaration and might cause your submission to get rejected. Keep this in mind while submitting your app to Play Store and remove these sensitive permission from your application's Manifest file if your app does not utilize these features from Pointr SDK.
{% endhint %}

## Permission Flow

{% tabs %}
{% tab title="Android" %}
Built-in sequential flow via `startPermissionFlow()`:

```
Necessary Permissions → Location Service → Bluetooth Enable → Background Location → Complete
```

{% endtab %}

{% tab title="iOS" %}
Built-in sequential flow via `requestNecessaryPermissions(completion:)`:

```
Necessary Permissions → Location → Notification → Core Motion → Complete
```

{% endtab %}
{% endtabs %}

Each step is skipped automatically if:

* The permission is already granted
* The corresponding override (Android flag / iOS delegate function) returns `false`
* The feature requiring that permission is disabled in the configuration

{% hint style="warning" %}
**Confirmed:** on iOS, the single "Location" step in `requestNecessaryPermissions` only requests **When In Use** authorization. **Always** authorization is *not* part of the automatic flow — it must be requested separately via `requestLocationAuthorizationPermissionForAlways()`. This mirrors Android's design intent (where Background Location is also a separate, later step) but the iOS flow diagram doesn't make the separation explicit the way Android's does.
{% endhint %}

## Overriding Permission Requests

{% tabs %}
{% tab title="Android" %}
Suppress individual permission requests by setting flags directly on `PermissionManager`:

```kotlin
val permissionManager = Pointr.getPointr()?.permissionManager

// Suppress specific permission requests
permissionManager?.shouldRequestBluetoothService = false
permissionManager?.shouldRequestBluetoothPermission = false
permissionManager?.shouldRequestLocationService = false
permissionManager?.shouldRequestLocationPermissionForAlways = false
permissionManager?.shouldRequestLocationPermissionForWhileInUse = false
permissionManager?.shouldRequestNotificationPermission = false
```

When a flag is set to `false`, the SDK will never show the corresponding permission dialog, regardless of the server configuration.
{% endtab %}

{% tab title="iOS" %}
Suppress individual permission requests by implementing `PTRPermissionManagerDelegate`:

```swift
Pointr.shared.permissionManager?.delegate = self

extension YourDelegateClass: PTRPermissionManagerDelegate {
    func permissionManagerShouldRequestLocationAuthorizationPermissionForWhenInUse(_ permissionManager: PTRPermissionManagerInterface) -> Bool {
        return false
    }

    func permissionManagerShouldRequestLocationAuthorizationPermissionForAlways(_ permissionManager: PTRPermissionManagerInterface) -> Bool {
        return false
    }

    func permissionManagerShouldRequestCoreMotionAuthorizationPermission(_ permissionManager: PTRPermissionManagerInterface) -> Bool {
        return false
    }

    func permissionManagerShouldRequestNotificationPermission(_ permissionManager: any PTRPermissionManagerInterface) -> Bool {
        return false
    }
}
```

When a delegate function returns `false`, the SDK will never show the corresponding permission prompt, regardless of the cloud configuration.
{% endtab %}
{% endtabs %}

When not explicitly overridden (Android: flag left `null`; iOS: delegate function not implemented), the SDK decides automatically based on whether positioning, beacon/GPS positioning, or geofencing features are enabled.

## Necessary Permissions API

{% tabs %}
{% tab title="Android" %}
The SDK exposes a computed list of permissions that are currently needed but not yet granted:

```kotlin
val permissions: List<String> = permissionManager?.necessaryPermissions ?: emptyList()
```

This list includes `ACCESS_FINE_LOCATION`, `BLUETOOTH_SCAN`, `BLUETOOTH_CONNECT`, and `POST_NOTIFICATIONS` based on the `shouldRequest*` flags, which permissions are already granted, and the current Android API level.

{% hint style="warning" %}
`ACCESS_BACKGROUND_LOCATION` is **not** included in `necessaryPermissions`. Background location is requested separately as the final step of the permission flow, after foreground location permission has been granted.
{% endhint %}

To request only the necessary permissions in a single call:

```kotlin
permissionManager?.requestOnlyNecessaryPermissions(activity, requestCode)
```

You can also request permissions individually:

```kotlin
// Location
permissionManager?.requestLocationPermissionForWhileInUse(activity, requestCode)
permissionManager?.requestLocationPermissionForAlways(activity, requestCode) // Requires API 29+

// Bluetooth (requires API 31+)
permissionManager?.requestBluetoothPermission(activity, requestCode)
permissionManager?.requestBluetoothConnectPermission(activity, requestCode)

// Notifications (requires API 33+)
permissionManager?.requestNotificationPermission(activity, requestCode)

// Services
permissionManager?.requestLocationService(activity)
permissionManager?.requestBluetoothService()
```

{% endtab %}

{% tab title="iOS" %}
iOS doesn't expose a separate computed list of outstanding permissions — call `requestNecessaryPermissions` directly and read the result:

```swift
permissionManager?.requestNecessaryPermissions(completion: ((PTRPermissionRequestResult) -> Void)?)
```

You can also request permissions individually:

```swift
// Location
permissionManager?.requestLocationAuthorizationPermissionForWhenInUse()
permissionManager?.requestLocationAuthorizationPermissionForAlways()

// Notifications
permissionManager?.requestUserNotificationAuthorizationPermission()

// Core Motion (iOS 17+)
permissionManager?.requestCoreMotionAuthorizationPermission()
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
**Doc gap, unconfirmed:** the source docs don't say whether iOS has a `necessaryPermissions`-equivalent list-returning accessor. If one exists, it should be added here for parity with Android; if not, worth calling out explicitly as an intentional API difference.
{% endhint %}

## Disabling All Permission Popups

If you want the SDK to show no permission dialogs/prompts at all — for example when the host app handles permissions on its own — combine the following:

{% stepper %}
{% step %}

## Disable onboarding

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

```kotlin
val config = PTRMapWidgetConfiguration()
config.isOnboardingEnabled = false
```

{% endtab %}

{% tab title="iOS" %}

```swift
let config = PTRMapWidgetConfiguration()
config.isOnboardingEnabled = false
```

{% endtab %}
{% endtabs %}
{% endstep %}

{% step %}

## Disable all permission requests

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

```kotlin
val permissionManager = Pointr.getPointr()?.permissionManager

permissionManager?.shouldRequestBluetoothService = false
permissionManager?.shouldRequestBluetoothPermission = false
permissionManager?.shouldRequestLocationService = false
permissionManager?.shouldRequestLocationPermissionForAlways = false
permissionManager?.shouldRequestLocationPermissionForWhileInUse = false
permissionManager?.shouldRequestNotificationPermission = false
```

{% endtab %}

{% tab title="iOS" %}

```swift
Pointr.shared.permissionManager?.delegate = self

extension YourDelegateClass: PTRPermissionManagerDelegate {
    func permissionManagerShouldRequestLocationAuthorizationPermissionForWhenInUse(_ permissionManager: PTRPermissionManagerInterface) -> Bool {
        return false
    }

    func permissionManagerShouldRequestLocationAuthorizationPermissionForAlways(_ permissionManager: PTRPermissionManagerInterface) -> Bool {
        return false
    }

    func permissionManagerShouldRequestCoreMotionAuthorizationPermission(_ permissionManager: PTRPermissionManagerInterface) -> Bool {
        return false
    }

    func permissionManagerShouldRequestNotificationPermission(_ permissionManager: any PTRPermissionManagerInterface) -> Bool {
        return false
    }
}
```

{% endtab %}
{% endtabs %}
{% endstep %}
{% endstepper %}

{% hint style="warning" %}
When all permission requests are disabled, the host application is responsible for requesting and managing the necessary permissions. The SDK will still function correctly once the required permissions are granted by the host app.

* **Android** monitors permission state changes at runtime through `PermissionRegistry` and reacts accordingly when permissions become available.
* **iOS** monitors permission state changes through `CLLocationManagerDelegate`, `CBManager`, and `UNUserNotificationCenter` callbacks, and reacts accordingly.
  {% endhint %}

{% hint style="info" %}
On Android, overriding permissions always takes effect — the SDK will never show a permission dialog for a flag set to `false`, whether or not onboarding is enabled.

On iOS, an override does **not** suppress prompts that occur inside the onboarding flow itself — see [Quick Reference](#quick-reference), Scenario #4. To fully suppress all prompts on iOS, you must disable onboarding *in addition to* overriding the permission delegate functions.
{% endhint %}

## Custom Permission Flow

{% tabs %}
{% tab title="Android" %}
For full control over the permission flow, use `startPermissionFlow()` with custom callbacks:

```kotlin
permissionManager?.startPermissionFlow(
    activity = activity,
    launchers = PermissionFlowLaunchers(
        permissionLauncher = permissionLauncher,
        locationServiceLauncher = locationServiceLauncher,
        bluetoothEnableLauncher = bluetoothEnableLauncher,
        backgroundLocationLauncher = backgroundLocationLauncher
    ),
    shouldLaunchBluetoothService = { true },
    onBeforeBackgroundLocationRequest = { onProceed, onCancel ->
        showCustomDialog(
            onYes = { onProceed() },
            onNo = { onCancel() }
        )
    },
    onComplete = {
        // Permission flow finished
    }
)
```

Each launcher must call the corresponding result method when it receives a result:

```kotlin
val permissionLauncher = registerForActivityResult(RequestMultiplePermissions()) {
    permissionManager?.onPermissionsFlowResult()
}

val locationServiceLauncher = registerForActivityResult(StartIntentSenderForResult()) {
    permissionManager?.onLocationServiceFlowResult()
}

val bluetoothEnableLauncher = registerForActivityResult(StartActivityForResult()) {
    permissionManager?.onBluetoothEnableFlowResult()
}

val backgroundLocationLauncher = registerForActivityResult(RequestMultiplePermissions()) {
    permissionManager?.onBackgroundLocationFlowResult()
}
```

{% endtab %}

{% tab title="iOS" %}
For full control over the permission flow, use `requestNecessaryPermissions()` with a completion callback:

```swift
permissionManager.requestNecessaryPermissions { result in
    // Permission manager flow completed
}
```

The callback returns `PTRPermissionRequestResult`:

```swift
public class PTRPermissionRequestResult {

    /// `true` if location authorization was required and the user granted
    /// `.authorizedWhenInUse` or `.authorizedAlways`.
    public let isLocationAuthorized: Bool

    /// `true` if user notification authorization was required and the user granted
    /// `.authorized`, `.provisional`, or `.ephemeral`.
    public let isUserNotificationAuthorized: Bool

    /// `true` if core motion authorization was required and the user granted `.authorized`.
    /// Always `false` when running on an OS older than iOS 17.4.
    public let isCoreMotionAuthorized: Bool
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
Android's custom flow exposes per-step launchers (location, service, Bluetooth, background location) and a pre-background-location interception hook (`onBeforeBackgroundLocationRequest`). iOS's custom flow is a single completion callback with no equivalent per-step interception hooks or Bluetooth step (consistent with the Bluetooth gap noted above).
{% endhint %}

## Permission States

{% tabs %}
{% tab title="Android" %}
**Current State**

```kotlin
// Location
permissionManager?.locationPermissionState       // Always, WhileInUse, Indeterminate
permissionManager?.hasLocationPermissionAlways    // Boolean
permissionManager?.hasLocationPermissionWhileInUse // Boolean
permissionManager?.isLocationServicesEnabled      // Boolean

// Bluetooth
permissionManager?.bluetoothPermissionState      // Granted, Indeterminate, Ineligible
permissionManager?.bluetoothServiceState         // On, Off, Corrupted
permissionManager?.hasBluetoothPermission        // Boolean
permissionManager?.isBluetoothServicesEnabled     // Boolean

// Notifications
permissionManager?.hasNotificationPermission     // Boolean
```

**Listener**

```kotlin
permissionManager?.addListener(object : PermissionManager.Listener {
    override fun onLocationPermissionGranted(state: LocationPermissionState) { }
    override fun onLocationServiceStateUpdate(isEnabled: Boolean) { }
    override fun onBluetoothPermissionGranted(state: BluetoothPermissionState) { }
    override fun onBluetoothServiceStateUpdate(state: BluetoothServiceState) { }
    override fun onNotificationPermissionGranted() { }
})
```

{% endtab %}

{% tab title="iOS" %}
**Listener**

```swift
permissionManager?.addListener(self)

extension MyViewController: PermissionManagerListener {
    func permissionManager(
        _ permissionManager: PTRPermissionManagerInterface,
        didUpdateLocationServicesState isLocationServicesEnabled: Bool
    )
    func permissionManager(
        _ permissionManager: PTRPermissionManagerInterface,
        didUpdateLocationAuthorizationStatus status: CLAuthorizationStatus,
        oldStatus: CLAuthorizationStatus
    )
    func permissionManager(
        _ permissionManager: PTRPermissionManagerInterface,
        didUpdateLocationAccuracyStatus status: CLAccuracyAuthorization
    )
    func permissionManager(_ permissionManager: PTRPermissionManagerInterface,
        didUpdateUserNotificationAuthorizationStatus status: UNAuthorizationStatus,
        oldStatus: UNAuthorizationStatus
    )
    @available(iOS 17.4, *)
    func permissionManager(
        _ permissionManager: PTRPermissionManagerInterface,
        didUpdateCoreMotionAuthorizationStatus status: CMAuthorizationStatus,
        oldStatus: CMAuthorizationStatus
    )
    func permissionManager(
        _ permissionManager: PTRPermissionManagerInterface,
        didFinishRequestingNecessaryPermissions result: PTRPermissionRequestResult
    )
    func permissionManagerPermissionRequirementsChanged(_ permissionManager: PTRPermissionManagerInterface)
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
**Doc gap, unconfirmed:** the iOS source doc has no "Current State" section with direct property accessors (Android has `locationPermissionState`, `hasBluetoothPermission`, etc.). iOS may expose equivalent properties that just weren't documented, or state may only be observable via the listener callbacks and raw `CLAuthorizationStatus`/`UNAuthorizationStatus` values shown above. Worth confirming with the iOS SDK team so this section has real parity.
{% endhint %}

## Configuration-Based Behavior

When overrides are not explicitly set (Android: `shouldRequest*` flags / iOS: delegate functions), the SDK uses the following logic to determine whether to request each permission:

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

| Flag                                           | Automatically enabled when                                                                                       |
| ---------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| `shouldRequestBluetoothService`                | Positioning enabled **and** beacon positioning enabled (foreground or background) **and** BLE scan not always on |
| `shouldRequestBluetoothPermission`             | Positioning enabled **and** beacon positioning enabled (foreground or background)                                |
| `shouldRequestLocationService`                 | Positioning enabled with any provider (GPS or beacon) **or** geofencing enabled                                  |
| `shouldRequestLocationPermissionForWhileInUse` | Positioning enabled with any foreground provider **or** geofencing enabled                                       |
| `shouldRequestLocationPermissionForAlways`     | Positioning enabled with any background provider **or** geofencing enabled                                       |
| `shouldRequestNotificationPermission`          | API 33+ **and** (geofence notifications enabled **or** background positioning enabled)                           |
| {% endtab %}                                   |                                                                                                                  |

{% tab title="iOS" %}

| Delegate function                                          | Automatically enabled when                                                 |
| ---------------------------------------------------------- | -------------------------------------------------------------------------- |
| `shouldRequestLocationAuthorizationPermissionForWhenInUse` | Positioning enabled with any foreground provider **or** geofencing enabled |
| `shouldRequestLocationAuthorizationPermissionForAlways`    | Positioning enabled with any background provider **or** geofencing enabled |
| `shouldRequestNotificationPermission`                      | Geofence notifications enabled **or** background positioning enabled       |
| `shouldRequestCoreMotionAuthorizationPermission`           | Geofence notifications enabled                                             |
| {% endtab %}                                               |                                                                            |
| {% endtabs %}                                              |                                                                            |

{% hint style="info" %}
If the corresponding feature is disabled in the server configuration, the SDK will not request the permission even if the override is not explicitly set, on either platform.
{% endhint %}

## Quick Reference

The table below summarizes how the SDK behaves depending on whether onboarding is enabled and whether permission requests are overridden:

| Scenario | Onboarding | Permissions Overridden | iOS Prompts Shown | Android Prompts Shown |
| -------- | ---------- | ---------------------- | ----------------- | --------------------- |
| #1       | No         | No                     | YES               | YES                   |
| #2       | No         | Yes                    | NO                | NO                    |
| #3       | Yes        | No                     | YES               | YES                   |
| #4       | Yes        | Yes                    | YES               | NO                    |

**Scenario #1** — Onboarding is disabled and permissions are not overridden. The SDK requests all necessary permissions directly, on both platforms.

**Scenario #2** — Onboarding is disabled and permissions are overridden. The SDK does not prompt for any permissions, on either platform. The host app is fully responsible for requesting them.

**Scenario #3** — Onboarding is enabled and permissions are not overridden. The SDK shows the onboarding flow and requests all necessary permissions as part of that flow, on both platforms.

**Scenario #4** — Onboarding is enabled but permissions are overridden. On **Android**, the SDK respects the override and does not prompt for permissions, even during onboarding. On **iOS**, the SDK still prompts for permissions as part of the onboarding flow regardless of the override.

{% hint style="info" %}
Overriding permissions always takes effect on **Android**, regardless of onboarding state. On **iOS**, an override only takes effect outside of the onboarding flow — to fully suppress all prompts on iOS you must also disable onboarding (see [Disabling All Permission Popups](#disabling-all-permission-popups)).
{% endhint %}


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://dev.pointr.tech/features/indoor-location-blue-dot/operating-system-permissions.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
