Skip to main content
Interim hand-authored reference. This page is authored from the SeamSDK public Swift sources. See the reference overview for context.

Overview

SeamCredentialError is a public enum that conforms to Error, Equatable, and Hashable. It appears in two places:
  1. As elements of SeamCredential.errors — the list of active errors on a credential.
  2. As the associated value of SeamError.credentialErrors([SeamCredentialError]) — thrown by Seam.unlock.
public enum SeamCredentialError: Error, Equatable, Hashable
Note: The order of errors in the errors array reflects priority — handle earlier errors first.

Cases

CaseDescription
awaitingLocalCredentialThe system is waiting for a local credential to become available.
expiredThe credential has expired and is no longer valid.
userInteractionRequired(RequiredUserInteraction)User interaction is required to resolve the credential issue. The associated value specifies what action the user must take.
contactSeamSupportA configuration error requires developer attention. Contact Seam support.
unsupportedDeviceThe current device is not supported.
unknownAn unclassified or unexpected credential error occurred.

userInteractionRequired(_:)

case userInteractionRequired(RequiredUserInteraction)
Indicates that the user must take a specific action before this credential can be used. The associated value is a RequiredUserInteraction that describes what the user must do.

RequiredUserInteraction

RequiredUserInteraction is a nested public enum that conforms to Sendable, Equatable, Codable, and Hashable. It enumerates the specific actions a user must take to resolve a userInteractionRequired error.
public enum RequiredUserInteraction: Sendable, Equatable, Codable, Hashable

Cases

CaseDescription
completeOtpAuthorization(otpUrl: URL)The user must complete OTP authorization at the provided URL. The associated otpUrl is the webpage where the OTP should be entered.
enableInternetThe user must enable internet connectivity.
enableBluetoothThe user must enable Bluetooth on the device.
grantBluetoothPermissionThe user must grant Bluetooth permission to the app.
appRestartRequiredThe user must restart the app to resolve the issue.

Example

for error in credential.errors {
    switch error {
    case .expired:
        showExpiredBanner()

    case .userInteractionRequired(let action):
        switch action {
        case .completeOtpAuthorization(let url):
            openBrowser(url: url)
        case .enableBluetooth:
            promptEnableBluetooth()
        case .grantBluetoothPermission:
            promptBluetoothPermission()
        case .enableInternet:
            promptEnableInternet()
        case .appRestartRequired:
            promptAppRestart()
        }

    case .awaitingLocalCredential:
        showLoadingIndicator()

    case .contactSeamSupport, .unsupportedDevice, .unknown:
        showGenericError()
    }
}
See also: SeamCredential.errors, SeamError.credentialErrors