iOS
Initialization allows the SDK to perform detections in the background. You must always initialize the SDK before interacting with it. Only a limited set of SDK methods are safe to invoke on an uninitialized SDK.
Steps
1
2
Initialize the SDK
In the application:didFinishLaunchingWithOptions: method of your AppDelegate class, call initializeAsync().
import SENTSDK
class AppDelegate: NSObject, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
let options = SENTOptions(for: .appLaunch)
Sentiance.shared.initializeAsync(options: options, launchOptions: launchOptions) { result, error in
if let result {
NSLog("Initialization succeeded")
}
else if let error {
NSLog("Initialization failed with reason \(error.failureReason)")
}
}
return true
}
}3
Next: User Creation
After having successfully initialized the Sentiance SDK, you must now create a user. To do so, follow the instructions on this page.
Last updated