initializeAsync
Initializes the Sentiance SDK, thereby preparing it to resume detections if a Sentiance user exists, and if detections were last enabled. If a user does not exist, this method does only minimal work to allow user creation. To create a user, call createUser.
This is the asynchronous variant of the initialize method. Use this variant if you want to minimize the impact of the SDK initialization on the startup duration of your app. However, note that interacting with most Sentiance SDK APIs requires an initialized SDK. Therefore, make sure to handle a delayed or failed initialization in other parts of your app, by utilizing the PendingOperation returned by this method.
To ensure proper continuity of SDK detections across app restarts, this method must still be called inside onCreate, on the main application thread, before onCreate returns. The call must not be done asynchronously, as doing so cannot guarantee its invocation prior to the completion of the app startup. This asynchronous initializer does minimal necessary work on the calling thread, and offloads the heavier parts of the SDK initialization to the background. For more information about this requirement, see: SDK Initialization
You should initialize the SDK at most once, normally during app startup. Initializing it multiple times will fail with reason REINITIALIZATION_NOT_ALLOWED, unless a Sentiance user does not yet exist (e.g. before user creation, or after an SDK reset), in which case multiple invocations of this method are still allowed.
Note that most SDK methods require an initialized SDK before being invoked, otherwise they throw a runtime exception. Methods excluded from this requirement indicate this in their respective documentation.