Skip to main content
Interim hand-authored reference. This page is authored directly from the Seam Android SDK public Kotlin sources. See the reference overview for context.

Overview

SeamCredentialError is a sealed class that extends SeamError. It represents errors specific to a single credential. These errors appear in two places:
  1. As elements of SeamCredential.errors — the list of active errors on a credential.
  2. As elements of the errors list inside SeamError.CredentialErrors, thrown by SeamSDK.getInstance().unlock().
sealed class SeamCredentialError : SeamError() {
    class Loading : SeamCredentialError()
    class Expired : SeamCredentialError()
    data class UserInteractionRequired(
        val interaction: SeamRequiredUserInteraction
    ) : SeamCredentialError()
    class Unknown : SeamCredentialError()
}

Subtypes

SubtypeDescription
LoadingThe credential has not finished loading yet. Retry the operation shortly.
ExpiredThe credential has expired and can no longer be used for unlocking.
UserInteractionRequired(val interaction: SeamRequiredUserInteraction)The user must take a specific action before this credential can be used. The interaction property describes what action is required.
UnknownAn unclassified or unexpected credential error occurred.

UserInteractionRequired

data class UserInteractionRequired(
    val interaction: SeamRequiredUserInteraction
) : SeamCredentialError()
Indicates that a user action is needed before the credential can be used. The interaction property is a SeamRequiredUserInteraction that describes the specific action required. See also: SeamRequiredUserInteraction

Example

lifecycleScope.launch {
    SeamSDK.getInstance().credentials.collect { credentialsList ->
        credentialsList.forEach { credential ->
            credential.errors.forEach { error ->
                when (error) {
                    is SeamCredentialError.Expired -> {
                        showExpiredBanner(credential)
                    }
                    is SeamCredentialError.Loading -> {
                        // Not ready yet — the SDK will emit an update when loaded
                        showLoadingIndicator(credential)
                    }
                    is SeamCredentialError.UserInteractionRequired -> {
                        handleUserInteraction(error.interaction)
                    }
                    is SeamCredentialError.Unknown -> {
                        showGenericError(credential)
                    }
                }
            }
        }
    }
}
See also: SeamError.CredentialErrors, SeamRequiredUserInteraction