2. Installation

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.

The latest version of the Sentiance React Native module is 4.4.8.

Add the NPM Dependency

Run the following command in your terminal window, inside the project directory:

npm install --save react-native-sentiance

The Sentiance React Native module should now be added to your **** project's package.json file.

package.json
{
  ...,
  "dependencies": {
    ...,
    "react-native-sentiance": "^4.4.8"
  }
}

Update the Podfile for iOS

Add the following lines to the Podfile file in your project's ios directory:

ios/Podfile
pod 'RNSentiance', :path => '../node_modules/react-native-sentiance/ios/RNSentiance.podspec'
pod 'SENTSDK', :podspec => '../node_modules/react-native-sentiance/ios/SENTSDK.podspec'

Then in the terminal window, run the following command inside your project's ios directory:

pod install --repo-update

Include the SDK for Android

Add the following lines to the settings.gradle file in your project's android directory:

android/settings.gradle
include ':react-native-sentiance'
project(':react-native-sentiance').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-sentiance/android')

Add the Sentiance repository to the build.gradle file in your project's android directory:

android/build.gradle
allprojects {
    repositories {
        ...
        maven { url "http://repository.sentiance.com" }
    }
}

Finally, add a dependency to the React Native project to your app's build.gradle:

android/app/build.gradle
dependencies {
    ...
    implementation project(':react-native-sentiance')
}

Last updated