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:

  1. Click on your Project > Your application target > Signing & Capabilities.
  2. Click + Capability.

    Select +Capability under Signing & Capabilities

  3. Double-click on Background modes.

    Background Modes is selected under Capabilities

  4. Select Location updates.

    Location updates is checked.

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:

  1. Click on your Project > Your application target > Info.

  2. Navigate to Custom iOS Target Properties section.

  3. Hover over to add a row for each of these keys to your Info.plist:

    1. NSLocationAlwaysAndWhenInUseUsageDescription
    2. NSLocationAlwaysUsageDescription
    3. NSLocationWhenInUseUsageDescription
Usage description keys added to Custom iOS Target properties

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:

Warning: Failing to complete these steps may result in the SDK versions lower that 4.7.2 not functioning properly. Contact Medallia Support for assistance.
  1. Open the Info.plist file from your project.

  2. 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>