Skip to main content
Auto-generated from the Seam Android SDK Kotlin sources. Do not edit by hand — see codegen/android-reference/.

Overview

This is the main entry point for the Seam Android SDK. Use the 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
  • initialize is thread-safe and idempotent

StateFlow Lifecycle

  • credentials: Emits whenever credential list changes, survives configuration changes
  • unlockStatus: Emits unlock events, latest event is always available via .value
  • isActivated: Reflects current SDK activation state
Collecting these flows is lifecycle-safe when used with Android lifecycle-aware scopes

Offline Behavior

  • SDK caches credentials and can work offline for unlock operations
  • activate requires internet connection initially
  • refresh requires internet connection
  • unlock can 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 initialize once per app session, typically in Application.onCreate()
  • activate when user wants to use credential features
  • No explicit cleanup needed - Android handles resource cleanup
  • deactivate stops 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:
Parameters Throws
  • 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.
Returns — The initialized SeamSDK instance. Throws
  • SeamError.InitializationRequired — if initialize has 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.
Parameters

setNotification

Sets the notification for the unlock feature. Required for Assa Abloy foreground scanning.
Parameters

setCredentialsListener

Sets the listener for the credentials.
Parameters

listCredentials

Lists the credentials for the current app user.
Returns — a SeamResult of a list of AcsPhoneCredential. If the SDK has not been initialized yet, the result will be a SeamFailure with 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.
Parameters Returns — a Job that can be used to cancel the unlock operation. Throws
  • 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.
Throws
  • 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.
Parameters Throws
  • 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.
Returns — The updated list of credentials after refresh completes. Throws
  • SeamError.InitializationRequired — if the SDK has not been initialized yet.
  • SeamError.DeactivationInProgress — if a deactivation is in progress.