activate
Activates the app user's phone.
Prepares the SDK for use by syncing with the server and setting up background services. This operation requires an active internet connection on first activation. Safe to call multiple times - subsequent calls are no-ops if already activated.
After successful activation, isActivated will emit true
and credentials will start syncing automatically.
val seamSDK = SeamSDK.getInstance()
try {
// activate is a suspend function
seamSDK.activate()
} catch (seamError: SeamError) {
when (seamError) {
is SeamError.InitializationRequired -> {
// handle error when SDK is already initialized
}
is SeamError.InternetConnectionRequired -> {
// handle error when internet connection is required
}
is SeamError.InvalidClientSessionToken -> {
// handle error when client session token is invalid
}
else -> {
// handle other errors
}
}
}
Content copied to clipboard
Throws
if the SDK has not been initialized yet.
if no internet connection is available.
if the client session token is invalid.