initialize

fun initialize(configuration: DotSdk.Configuration)

Initializes IDV SDK with the given Configuration (license, libraries and their feature modules). Must be called on a background thread.

Using any component before initialization, or a feature module that was not activated in the Configuration, throws an exception. While the app is in the background the system may kill the process to free resources; in that case - and only then - you must initialize again when the app returns to the foreground (guard this with isInitialized).

Thread-safety: initialize and deinitialize must not run concurrently. The common guard if (!DotSdk.isInitialized()) DotSdk.initialize() is a check-then-act that is not atomic - if two threads run it at the same time, both can pass the isInitialized check, both call initialize, and the second call then throws. Route all initialize / deinitialize calls through a single owner that also performs the isInitialized guard (see the DotSdkInitializer in the Samples project).

Parameters

configuration

Configuration for IDV SDK.

Throws

if IDV SDK is already initialized.