# Permissions

## Localization Keys

There are localization keys (Cocoa keys) that are necessary for trip detection. In order to implement these keys, click on your project's root directory in the Project Navigator:

<div data-full-width="false"><figure><img src="/files/NfBhhhvz12LTf96WwikD" alt="" width="287"><figcaption><p>Click on the root directory of your project, which is found at the very top of your Project Navigator.</p></figcaption></figure></div>

Select your app's target and click on the **Info** tab, which will then show you a list of currently active keys (under **Custom iOS Target Properties**).

<figure><img src="/files/9XVI0YE4S2Ncr3emDbfH" alt="" width="145"><figcaption><p>Click on your app's target under the 'TARGETS' tab.</p></figcaption></figure>

To add a new key, hover over any existing key and click on the + icon (or right-click a key and click on "Add Row"). When you start typing in the name of the key, it will pop up in the dropdown menu. Enter the following four keys:

* `Privacy - Location Always Usage Description`
* `Privacy - Location Always And When In Use Usage Description`
* `Privacy - Location When In Use Usage Description`
* `Privacy - Motion Usage Description`

For each of these keys, add a meaningful description (under **Value**) to explain the purpose of the permission. It may be a good idea to localize these descriptions if your app supports multiple languages.

## Background Modes

To integrate `TripDetection` or `TripDetectionUmbrella` into your own app, you must enable the following *Background Modes* in the **Signing & Capabilities** tab in your app's target:

* [x] Location updates

***TIP:*** Learn more about Apple's iOS background modes [here](https://developer.apple.com/documentation/uikit/app_and_environment/scenes/preparing_your_ui_to_run_in_the_background/extending_your_app_s_background_execution_time).

### Permissions

#### App side

The client app is responsible for requesting the proper permissions, and adding any required permissions to the manifest file of their app. The SDK uses APIs that require runtime permissions (Locations, Bluetooth). The SDK ensures that these permissions have been granted, and may trigger the permission dialog to present itself to the user when required.

#### Bluetooth devices

The SDK checks for Bluetooth authorizations before starting the feature. A failure when starting the Bluetooth Trip Detection feature is not reported as a failure to start trip detection.

It is possible for the client app to restrict download to only devices supporting Bluetooth LE by adding the UIRequiredDeviceCapabilities in the application plist. In this case, the Bluetooth Trip Detection feature is always available.


---

# 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://sdk.ims.tech/readme/ios/permissions.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.
