You should initialize the SDK every time the app is launched or app comes to foreground from background. For every initialization you will get authentication status using upshot authentication delegate. A session is created every time the SDK is initialized
To access Upshot.ai classes in your class/project we need to import Upshot.
Initialize Upshot.ai in two places. onAppLaunch and Application will enter Foreground.
You can find your config file in the Upshot.ai Dashboard and add it your root project. The fields can be further modified by altering the property values in the JSON file, eg: AppId OwnerId and so on.
There are multiple options that can be set/modified while initializing the SDK based on your application preferences and utilization of various system resources. All the initialization options for BrandKinesis can be found in BKProperties.h
Below are the list of initialization options and their descriptionsBKApplicationID: Application ID provided by Upshot.ai (can be viewed on dashboard)
BKApplicationOwnerID: Account ID provided by Upshot.ai (can be viewed on dashboard)
BKFetchLocation: By default, BKFetchLocation is disabled. To enable it, set this property to true while initializing BrandKinesis. This will help capture device’s location details
BKUseCellularData: Data can be sent to Upshot.ai through WiFi and/or Cellular data. By default, this option is enabled to allow Upshot.ai to use both Cellular and WIFI to connect with Upshot.ai servers. Set this option to false if only WiFi usage should be allowed.
BKEnableDebugLogs: Logs are disabled by default in the SDK. You can enable it by setting this property to true while initializing BrandKinesis.
BKExceptionHandler: Enabling this option allows Upshot.ai to capture crash logs and send it to the servers. This option is enabled by default.
Note:
Authentication Delegate:
By definition, every open app is a session. Hence, when the app goes to background the session should be terminated. And when the app comes back to the foreground, the session should be reinitialized.
Every successful authentication creates a new session. A session is terminated only when a call to terminate function/method is made. Repeated calls to initializeWithOptions: delegate: on the shared instance of BrandKinesis will terminate the existing session and create a new session. Also, you should make sure not to reinitialize the SDK when the user moves from one activity to the other in the same application to avoid multiple (duplicate) sessions being recorded.
on applicationDidEnterBackground terminate Upshot.ai