1. Including the SDK

Flutter

Install the Sentiance Core Plugin, by running the following command in your terminal, inside the project directory:

flutter pub add sentiance_core

The module should now be added to your project's pubspec.yaml file.

pubspec.yaml
dependencies:
  flutter:
    sdk: flutter
  sentiance_core: ^0.0.1
  ...

Native

Before moving forward, please ensure you follow the instructions tailored to your platform.

iOS Setup

Execute the pod install command to check for any issues. If you encounter an error resembling:

-> Installing sentiance_plugin (0.0.1)
  - Running pre install hooks
[!] The 'Pods-Runner' target has transitive dependencies that include 
statically linked binaries: (/path/to/flutter-app/ios/Pods/SENTSDK/SENTSDK.xcframework)

Instruct CocoaPods to statically link these frameworks rather than dynamically by updating the Podfile with:

target 'Runner' do
  use_frameworks! :linkage => :static
  ...
Building for the arm64 (M1 Mac) simulator

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'

More information about this custom framework can be found on this page.

Android setup

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" }
    }
}

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

Feature Packages

Similar to the Android's Artifacts you can install the Flutter plugins based on the features you would want to use your application. Following are the packages available

sentiance_core
sentiance_user_context
sentiance_event_timeline

Contact support to learn more about which features (and packages) best suit your use-case.

Last updated