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.
Follow the step below to integrate the iOS SDK.
1. Installation
1.1 Dependency
Include the following lines in your Podfile
platform :ios, '9.0'
pod 'SENTSDK'
And run the command
pod install --repo-update
If you are using Carthage instead, __
2. Configuration
2.2 Background Modes
Ensure you turn on Background Modes and enable Location updates
If you are going to use the Step Counter feature, you will need to set the property to YES, and enable Background Fetch in the capabilities **** and add a key to the app's plist**:** BGTaskSchedulerPermittedIdentifiers with an array item com.sentiance.backgroundtask.step_counter
2.3 Permissions
Ensure you include the following permission in info.plist
Insert the following line in your AppDelegate.swift file and in the didFinishLaunchingWithOptions method_._ This line ensures that the SDK is initialized and can collect data while the application is in the background.
# AppDelegate.swift
SentianceHelper.initSdk()
4. Data Collection & SDK User Creation
In order for the SDK to collect data the application would need to first "create a user" on the SDK. The "createUser" should ideally be called when the user registers, logs in.
4.2 Standard
4.1 createUser
Invoke the SentianceHelper.createUser method at the moment you are ready to start the data collection. (e.g on user login, on user registration, at a feature, etc)
note: Do not forget to Include your "linkFunction"
This function is expected to communicate/pass the installId (fetched from the SDK) to your backend
Note: This method will receive the parameters: installId, linkSuccess, linkFailure
4.3 User linking in your backend
Create an endpoint on your backend which will communicate with the Sentiance backend and request an installId to be linked to a particular user (in your database)
4.4 linkFunction -> linkSuccess()
Upon your backend successfully performing the user linking execute the
linkSucess()
method received as a parameter to you linkFunction
Verifying the Integration
You can verify the SDK integration by reading the following statuses from the SDK