Auto-generated from the Seam Android SDK Kotlin sources. Do not edit by hand — see mintlify-codegen/android-reference/.
Overview
getInstance function to get the instance of this class.
You can only get the instance of the class after you have initialized the SDK by calling
initialize.
The initialize function will initialize the SDK.
Thread Safety
- All StateFlow properties (
credentials,isActivated,unlockStatus) are thread-safe - All suspend functions can be called from any coroutine context
initializeis thread-safe and idempotent
StateFlow Lifecycle
credentials: Emits whenever credential list changes, survives configuration changesunlockStatus: Emits unlock events, latest event is always available via .valueisActivated: Reflects current SDK activation state
Offline Behavior
- SDK caches credentials and can work offline for unlock operations
activaterequires internet connection initiallyrefreshrequires internet connectionunlockcan work offline if credentials are already cached
Error Recovery
- Most operations can be safely retried after fixing underlying issues
- Credential errors (in SeamCredential.errors) should be resolved before unlock
- Network errors during activate/refresh are transient and can be retried
Background Processing
- Unlock operations continue in background
- StateFlow emissions work across app lifecycle
Lifecycle
- Call
initializeonce per app session, typically in Application.onCreate() activatewhen user wants to use credential features- No explicit cleanup needed - Android handles resource cleanup
deactivatestops background operations but preserves credentials
Companion object methods
initialize
Initializes the Seam Android SDK. This should be called once at the
start of your application.
Example:
| Parameter | Description |
|---|---|
context | the Android context. |
clientSessionToken | the client session token for the app user. |
SeamError.AlreadyInitialized— if the SDK is already initialized.SeamError.InternetConnectionRequired— if no internet connection is available.SeamError.InvalidClientSessionToken— if the token format is invalid.SeamError.DeactivationInProgress— if a deactivation is in progress.
getInstance
Returns the instance of SeamSDK. This can be used to get a handle to the
SeamSDK after it has been initialized.
This method is thread-safe and can be called from any thread.
SeamError.InitializationRequired— ifinitializehas not been called yet.
Properties
isActivated
Returns whether the app user’s phone has been activated.
This StateFlow emits true after successful activate call and false after deactivate.
The flow is thread-safe and can be collected from any coroutine context.
Latest value is always available via .value property.
credentials
Returns the list of SeamCredential for the current app user.
This StateFlow emits an immutable list whenever credentials change.
The list may be empty if no credentials are available or while loading.
Check each credential’s errors property to determine if it’s ready for use.
The flow is thread-safe and can be collected from any coroutine context.
Latest value is always available via .value property.
unlockStatus
Returns the current status of the unlock feature.
This StateFlow emits SeamUnlockEvent instances as unlock operations progress.
Events include scanning, connection, access granted, errors, and timeout.
The flow retains the latest event, accessible via .value property.
Subscribe to this flow before calling unlock to ensure no events are missed.
The flow is thread-safe and can be collected from any coroutine context.
Methods
setUnlockEventListener
Sets the listener for the unlock events.
| Parameter | Description |
|---|---|
listener | the listener to listen for unlock events. |
setNotification
Sets the notification for the unlock feature. Required for Assa Abloy foreground scanning.
| Parameter | Description |
|---|---|
notification | the notification to use for the unlock feature. |
setCredentialsListener
Sets the listener for the credentials.
| Parameter | Description |
|---|---|
listener | the listener to listen for credentials. |
listCredentials
Lists the credentials for the current app user.
SeamError.InitializationRequired.
unlock
Unlocks the app user’s phone.
Initiates an unlock operation for the specified credential. Progress events are emitted
to unlockStatus StateFlow. The operation continues even if the app goes to background.
Works offline if credentials are already cached. Requires the device to have the
necessary hardware (Bluetooth, NFC, etc.) and permissions granted.
| Parameter | Description |
|---|---|
credentialId | the credential ID to unlock. CredentialId is a type alias for String. |
timeout | the timeout for the unlock operation. If null, uses provider default. |
unlockProximity | the unlock proximity UnlockProximity. If null, uses provider default, which is the first in the list of SeamCredential.supportedUnlockProximities. The SeamCredential must have at least one supported unlock proximity. |
SeamError.InitializationRequired— if the SDK has not been initialized yet.SeamError.IntegrationNotFound— if the integration is not found.SeamError.InvalidCredentialId— if the credential ID is invalid.SeamError.ActivationRequired— if the app user’s phone has not been activated yet.SeamError.CredentialErrors— if the credential has unresolved errors.SeamError.InvalidUnlockProximity— if the unlock proximity is invalid.
suspend 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.
SeamError.InitializationRequired— if the SDK has not been initialized yet.SeamError.InternetConnectionRequired— if no internet connection is available.SeamError.InvalidClientSessionToken— if the client session token is invalid.
suspend deactivate
Deactivates the app user’s phone.
Stops background operations and cleans up resources. Credentials remain cached
and available for the next activation. After deactivation, isActivated will emit false.
This method is safe to call multiple times and will not throw if already deactivated.
| Parameter | Description |
|---|---|
deintegrate | If true, removes device association and clears all state. |
SeamError.InitializationRequired— if the SDK has not been initialized yet.SeamError.DeactivationInProgress— if a deactivation is already in progress.
suspend refresh
Refreshes the credentials for the current app user.
Manually triggers a sync with the server to fetch latest credentials.
This operation requires an active internet connection. You should call
initialize and activate first.
The credentials StateFlow will be updated before this method returns.
In most cases, automatic background sync makes manual refresh unnecessary.
SeamError.InitializationRequired— if the SDK has not been initialized yet.SeamError.DeactivationInProgress— if a deactivation is in progress.