3. Configuration

iOS // Configuring Xcode

  1. Go to Signing & Capabilities.

  2. Turn on Background Modes and enable Location updates.

Android // Configuring AndroidManifest.xml

Add the Required Permissions

When targeting API level 29 (Android 10), you must add the following permissions to your app's AndroidManifest.xml file.

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

See the Android permissions page for more details.

Customize the Notification

The Sentiance SDK needs to provide a notification to Android, which gets shown to the user when a foreground service is running. You can customize this notification via the AndroidManifest.xml file.

AndroidManifest.xml
<application ...>
    <meta-data android:name="com.sentiance.react.bridge.notification_title" android:resource="@string/app_name"/>
    <meta-data android:name="com.sentiance.react.bridge.notification_text" android:value="Touch to open."/>
    <meta-data android:name="com.sentiance.react.bridge.notification_icon" android:resource="@mipmap/ic_launcher"/>
    <meta-data android:name="com.sentiance.react.bridge.notification_channel_name" android:value="Sentiance"/>
    <meta-data android:name="com.sentiance.react.bridge.notification_channel_id" android:value="sentiance"/>
    
    ...
</application>

Last updated