Configure the SDK
Follow these steps to configure the Suki Mobile SDK:1
Import the Framework
In the Swift file where you will manage the SDK, import the framework:
2
Set the SDK Environment
Set the SDK environment by assigning a value to the
SukiAmbientCoreManager.shared.environment property. The recommended environments are .stage and .prod.3
Initialize the SDK
Call the
initialize method to configure the SDK. Call this method after a user signs in. If sign-in sessions persist, call it in your application delegate’s didFinishLaunchingWithOptions method.Initialization parameters
Theinitialize method takes the following parameters:
dictionary
boolean
Set this to
true if your app supports background recording. If true, recording continues when the app is in the background. Otherwise, recording pauses and you must resume it when the app returns to the foreground.completionHandler
A completion handler that is called with the result of the initialization, indicating success or failure.
delegateObject
An optional delegate object to receive callbacks for recording-level events.
TokenProvider
An object that conforms to the
tokenProvider protocol. Your application (client application) is responsible for providing a valid token when the SDK requests one through this protocol.The
tokenProvider is used for authenticating the mobile SDK. You must implement this tokenProvider protocol to get authentication tokens when needed.Error handling
Theinitialize method can throw a SukiAmbientCoreError. You should use a do-catch block, as shown in the example above, to handle any potential errors during initialization.
Bearer partners using the Mobile SDK:
-
When initializing the Mobile SDK, pass the
providerIdinProviderInfousingSukiAmbientConstant.kId. If the JWT does not include aprovider_idclaim, the SDK uses this value asprovider_idin the authentication and registration requests. - For more information, refer to Bearer partner authentication.