1. Including the SDK
Run the following command in your terminal, inside the project directory:
npm install @sentiance-react-native/core
The Sentiance Core React Native 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.Add the following line to the Podfile file in your project's ios directory:
ios/Podfile
pod 'RNSentianceCore', :path => '../node_modules/@sentiance-react-native/core/ios'
Then in the terminal, run the following command inside your project's ios directory:
pod install --repo-update
The Sentiance SDK itself supports the arm64 simulator architecture. However, the SDK has a dependency on TensorFlow Lite v2.7.0, which does not support arm64 simulators. To address this limitation, use our custom TensorFlow Lite v2.7.0 framework. In your Podfile, add the following entry:
Podfile
pod 'TensorFlowLiteC', :podspec => 'https://sentiance-u1-sdk-downloads.s3.eu-west-1.amazonaws.com/ios/frameworks/TensorFlowLiteC/2.7.0/TensorFlowLiteC.podspec'
Add the Sentiance maven repository to the build.gradle file in your project's android directory:
android/build.gradle
allprojects {
repositories {
...
maven { url "https://repository.sentiance.com" }
}
}
Once that's done, the Sentiance Core library needs to be linked to your project and your application needs to be rebuilt. The autolinking feature that comes with React Native 0.60 will take care of linking the library for you. Sentiance libraries are supported for React Native 0.60 and above, so you normally do not need to do any manual linking step.
Last modified 7mo ago