Permissions Handling

Description of required permissions, how to request and manage them.

Required Permissions

On SDK initialization, the host app passes a MoveConfig object to configure which of the SDK services should be activated. Some of those services require system permissions to be granted, or other features to be available.

circle-info

From a usability perspective, Apple provides some guidelines about Requesting Permissionsarrow-up-right as part of their Human Interface Guidelines.

The table below shows each of the MoveConfig options and the corresponding required and optional permissions or sensors.

Service

Required permissions

Optional permissions

TimelineDetectionService

Driving

Location Permission

Motion Permission Background Location Permission

Bicycle

Location Permission

Motion Permission

Background Location Permission

Walking

Motion Permission

Background Location Permission

Driving Services

Distraction-Free-Driving (DFD)

Gyroscope and Accelerometer availability

Driving behavior events (DBE)

Gyroscope and Accelerometer availability

Other Services

Points of Interest (POI)

Location Permission

Background Location Permission

triangle-exclamation

Location Permission

Authorization

circle-info

This section considers the iOS13 system location permissions changes.

Please check Location Permission Pre iOS13 for more information about handling the permission prior to iOS13

Starting iOS 13, system location is split into 2 layers: CLAuthorizationStatusarrow-up-right and CLAccuracyAuthorizationarrow-up-right

can be granted with one of the multiple access levels. Focusing only on the MOVE SDK relevant ones:

Starting iOS13, when an app requests.authorizedAlwaysarrow-up-rightthe system prevents apps from directly receiving the.authorizedAlwaysarrow-up-rightaccess level, but instead, the system breaks the access into 2 steps. First, it shows the user the permission prompt for.authorizedWhenInUsearrow-up-rightand later on, shows the.authorizedAlwaysarrow-up-rightpermission prompt when the app (in our case the MOVE SDK embedded in your app) fetches the location in the background for the first time.

Check this WWDC19 sessionarrow-up-right and apple documentationarrow-up-right for further information about the iOS13 authorization status changes.

triangle-exclamation

Automatic Detection

Starting iOS13, Apple introduced 2 levels of accuracy access:

circle-exclamation

Plist

Apple requires apps requesting any system permission to provide reasoning for granting the permission. This reasoning is known as "purpose string" and is defined in the app's Info.plist file. Those purpose strings are displayed as an explanation of why the app needs those access types, in the alert shown by the system to ask the user for permission.

In the case of location permission, each access level requires including one or more corresponding keys with purpose strings.

Key

Required if

Your app requests When In Use authorization or Always authorization.

Your app requests Always authorization.

Your app supports iOS 10 and earlier and requests Always authorization.

Background Mode

Moreover, for background location access, Location updates Background Modes must be enabled:

  1. Go to the Capabilities tab of your target settings

  2. Turn on Background Modes and enable Location updates

Location updates background mode capability
circle-info

For more details about how to request location permissions, check out this Apple documentarrow-up-right.

Sample Code

Requesting.authorizedAlwaysarrow-up-rightlocation authorization looks something like this:

Motion Permission

plist

Same as with Location permission, Motion permission requires including the NSMotionUsageDescriptionarrow-up-right with its corresponding purpose string in the app's Info.plist file.

Permission

There is no direct way to request Motion Activities access permission like with Locations. Instead, the permission prompts the first time the Motions API is called.

Requesting the motion permission will look something like this:

Last updated