For the complete documentation index, see llms.txt. This page is also available as Markdown.

CLI

If you are building your app without using a Framework.

External Dependencies

Apart from the core React Native libraries, there are no additional external React Native library dependencies.

For external dependencies in the native SDKs, check out this page for Android and this one for iOS.

Steps

1

Install the Sentiance Core React Native module

Run the command in Terminal:

Terminal
npm install @sentiance-react-native/core

The module should now be added to your project's package.json file.

package.json
{
  ...,
  "dependencies": {
    ...,
    "@sentiance-react-native/core": "^6.x.x"
  }
}

The @sentiance-react-native/core module must be installed before using any other Sentiance service.

2

Setup the Build Dependencies in the native folders

iOS Build Dependencies

  1. In the terminal, navigate to your project's iOS directory

  2. Run the command in Terminal:

Terminal
pod install --repo-update

Android Build Dependencies

Add the Sentiance repository to your project-level build.gradle file:

allprojects {
    repositories {
        ...
        maven { url "https://repository.sentiance.com" }
    }
}

This will allow Gradle to find and download the necessary native Sentiance SDK libraries.

All Sentiance modules support Autolinking, which is available since React Native v0.60, the minimum supported React Native version by Sentiance. Autolinking takes care of discovering and linking the native code dependencies to your project.

3

Configuration and permissions

Next, we'll configure the project settings and permissions for both iOS and Android.

iOS Configuration and Permissions

Open your existing app project in Xcode.

For project and permission settings, follow these 3 steps from the Native iOS Setup guide:

Android Configuration

When the Sentiance SDK runs in the background, it starts a foreground service. This causes Android to display a notification in the notification shade, and an icon on the system bar.

To customize this notification, you can update the AndroidManifest.xml file as follows:

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

By customizing the notification, you can tailor the appearance and behavior of the notification to match the branding and user experience of your application. This allows you to provide a seamless and consistent experience to your users while the Sentiance SDK operates in the background.

Please note that customizing the notification should be done carefully to ensure that it complies with Android guidelines and user preferences. By doing so, you can enhance the overall user experience and maintain a cohesive presentation of your app and the Sentiance SDK's background functionality.

4

Next: Initialize the SDK

After having included the Sentiance SDK, proceed to initializing the SDK.

Last updated