7. Permissions

This document refers to deprecated parts of the platform and has been left intact to help customers with legacy integrations. In order to access the latest platform features and documentation, please go to https://docs.sentiance.com.

To do proper detections, the Sentiance SDK requires a few permissions to be granted by the user at application runtime. The SDK does not ask for these permissions itself. Instead, after explaining to the user why you need each permission, you must present the permission dialogs as part of your application's flow.

An example implementation of a permission dialog is available in our Github app.

Location

When running the SDK on Android 6 and above, it is required to ask the user for the location permission. Additionally, if your build targets API level 29 and above, it is also required to ask for the background location access permission.

On Android 10 and above, without the background location access permission, SDK detections will not work. This permission enables the use of Geofences via Google Play Services, which the Sentiance SDK utilizes for detection stability and battery efficiency.

The SDK automatically adds the ACCESS_FINE_LOCATION permission to your app's manifest, however it does not add the ACCESS_BACKGROUND_LOCATION permission (see here). Instead, you must explicitly add it to your app as follows:

AndroidManifest.xml
<manifest...>
    <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION">
    ...

If any of these permissions is not granted, SdkStatus.isLocationPermGranted will be false.

Activity Recognition (Android 10+)

When targeting API level 29 and above, it is required to ask the user for the activity recognition permission. This permission grants access to the user's physical activity data (idle, walking, etc.).

The Sentiance platform requires motion activities to improve the SDK detection quality and to do Lifestyle Profiling. Moreover, without this permission, some detections won't be possible (e.g. running detection). For any questions, please contact our support.

The SDK does not add the android.permission.ACTIVITY_RECOGNITION permission to your app's manifest (see here). Instead, you must explicitly add it to your app as follows:

AndroidManifest.xml
<manifest...>
    <uses-permission android:name="android.permission.ACTIVITY_RECOGNITION">
    ...

When this permission is not granted, the SdkStatus.isActivityRecognitionPermGranted will be false.

Last updated