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

SeamUnlockProximity is a public enum that defines the required physical proximity for an unlock attempt. It is used as an input to Seam.unlock(using:proximity:timeout:) and as the element type of SeamCredential.supportedUnlockProximities.
public enum SeamUnlockProximity
This enum describes a requirement, not a capability — passing a proximity value tells the SDK the minimum physical closeness the caller requires for the operation.

Cases

CaseDescription
touchRequires the user’s mobile device to be physically touching the lock hardware or reader.
nearbyRequires the user to be within a few meters of the lock or reader (Bluetooth range).
remoteNo proximity requirement; the operation may be performed via network or relay.

Usage

Selecting proximity at unlock time

// Use the credential's default (first value in supportedUnlockProximities)
let publisher = try Seam.shared.unlock(using: credential.id)

// Require tap/at-reader proximity
let publisher = try Seam.shared.unlock(using: credential.id, proximity: .touch)

// Require on-site Bluetooth proximity
let publisher = try Seam.shared.unlock(using: credential.id, proximity: .nearby)

// Allow remote unlock
let publisher = try Seam.shared.unlock(using: credential.id, proximity: .remote)

Checking what a credential supports

// Display UI based on what the credential supports
if credential.supportedUnlockProximities.contains(.touch) {
    showTapToUnlockButton()
}
if credential.supportedUnlockProximities.contains(.remote) {
    showRemoteUnlockButton()
}

// The first entry is the credential's preferred/default proximity
let defaultProximity = credential.supportedUnlockProximities.first
See also: SeamCredential.supportedUnlockProximities, Seam.unlock(using:proximity:timeout:)