Configure location
Sense360 iOS SDK requires configuring these three location features:
Enable background modes
Follow these steps to configure your Xcode Project settings for the iOS SDK to run in the background:
- Click on your Project > Your application target > Signing & Capabilities.
Click + Capability.
Double-click on Background modes.
Select Location updates.
Add Location usage description
Location usage descriptions give users clarity into exactly why the application needs location. Add this usage descriptions on how you collect location when users are and are not using the application:
Click on your Project > Your application target > Info.
Navigate to Custom iOS Target Properties section.
Hover over to add a row for each of these keys to your
Info.plist
:NSLocationAlwaysAndWhenInUseUsageDescription
NSLocationAlwaysUsageDescription
NSLocationWhenInUseUsageDescription
Configure application permissions
As of Sense360 iOS SDK version 4.7.2, applications no longer need to explicitly request permission to access motion data through CoreMotion
. This update enhances user privacy and security compliance without requiring additional configuration in the Info.plist
file for motion data usage.
For versions prior to 4.7.2, follow the steps below to add the NSMotionUsageDescription
key to the project Info.plist
file, which provides a description to users explaining why the application needs access to motion data:
Open the
Info.plist
file from your project.Add the
NSMotionUsageDescription
key-value pair://XML <key>NSMotionUsageDescription</key> <string>This app requires motion data to function correctly.</string>
This example shows what your Info.plist
file might look like after adding the NSMotionUsageDescription
key:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
...
<key>NSMotionUsageDescription</key>
<string>This app requires motion data to function correctly.</string>
...
</dict>
</plist>