Search…
2. Installation
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:
1
npm install --save react-native-sentiance
Copied!
The Sentiance React Native module should now be added to your project's package.json file.
package.json
1
{
2
...,
3
"dependencies": {
4
...,
5
"react-native-sentiance": "^4.4.8"
6
}
7
}
Copied!

Update the Podfile for iOS

Add the following lines to the Podfile file in your project's ios directory:
ios/Podfile
1
pod 'RNSentiance', :path => '../node_modules/react-native-sentiance/ios/RNSentiance.podspec'
2
pod 'SENTSDK', :podspec => '../node_modules/react-native-sentiance/ios/SENTSDK.podspec'
Copied!
Then in the terminal window, run the following command inside your project's ios directory:
1
pod install --repo-update
Copied!

Include the SDK for Android

Add the following lines to the settings.gradle file in your project's android directory:
android/settings.gradle
1
include ':react-native-sentiance'
2
project(':react-native-sentiance').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-sentiance/android')
Copied!
Add the Sentiance repository to the build.gradle file in your project's android directory:
android/build.gradle
1
allprojects {
2
repositories {
3
...
4
maven { url "http://repository.sentiance.com" }
5
}
6
}
Copied!
Finally, add a dependency to the React Native project to your app's build.gradle:
android/app/build.gradle
1
dependencies {
2
...
3
implementation project(':react-native-sentiance')
4
}
Copied!