Skip to content

Commit 1bea741

Browse files
committed
update Mobile SDK docs for new Seam prefixed names and latest api changes
1 parent cc7b837 commit 1bea741

File tree

3 files changed

+51
-66
lines changed

3 files changed

+51
-66
lines changed

docs/capability-guides/mobile-access/mobile-device-sdks/handling-system-permissions.md

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,17 @@
22

33
Missing or required system permissions (Bluetooth, internet connectivity, etc.) are surfaced as `CredentialError.userInteractionRequired(action)` entries on each credential’s `errors` array. Observe these errors after activation and handle the specified actions. Errors are automatically updated to reflect current requirements.
44

5-
```swift
6-
import SeamSDK
7-
import Combine
8-
9-
private var permissionCancellable: AnyCancellable?
10-
```
11-
125
## Monitoring Permission Errors
136

14-
Use Combine to watch the published credentials array and handle permission-related errors:
15-
167
{% tabs %}
178
{% tab title="iOS Swift" %}
189

10+
Use Combine to watch the published credentials array and handle permission-related errors:
11+
12+
1913
```swift
2014
func startMonitoringPermissionErrors() {
21-
permissionCancellable = SeamSDKManager.shared.$credentials
15+
permissionCancellable = Seam.shared.$credentials
2216
.map { credentials in
2317
credentials.flatMap { credential in
2418
credential.errors.compactMap { error in
@@ -37,7 +31,7 @@ func startMonitoringPermissionErrors() {
3731
{% endtabs %}
3832

3933

40-
The SDK automatically clears resolved permission errors once the required permission is granted, reflecting the updated credential state.
34+
The Seam SDK automatically clears resolved permission errors once the required permission is granted, reflecting the updated credential state.
4135

4236
## Handling Permission Actions
4337

docs/capability-guides/mobile-access/mobile-device-sdks/initializing-the-seam-mobile-sdk.md

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ dependencies {
3737

3838
{% tab title="iOS Swift" %}
3939
You can install SeamSDK via CocoaPods or Swift Package Manager (SPM).
40-
SeamSDK supports per-lock-provider integration granularity--include only the modules you need to keep your app footprint minimal.
40+
SeamSDK supports per-lock-provider integration granularity--include only the modules you need to minimize your app's footprint.
4141

4242
{% code title="Podfile" %}
4343
```ruby
@@ -86,7 +86,7 @@ See the [device or system integration guide](../../../device-and-system-integrat
8686

8787
### iOS Requirement
8888

89-
To prevent Apple Wallet from appearing while scanning for Bluetooth low energy (BLE) or similar locks, request the `com.apple.developer.passkit.pass-presentation-suppression` entitlement for your app from the Apple Developer portal.
89+
While not required, you can optionally request the `com.apple.developer.passkit.pass-presentation-suppression` entitlement from the Apple Developer portal. This entitlement prevents Apple Wallet from appearing when scanning for Bluetooth low energy (BLE) or similar locks, improving the unlock experience.
9090

9191
***
9292

@@ -206,7 +206,7 @@ $token = $client_session->token;
206206
## 4. Initialize the Mobile SDK with the Client Session Token
207207

208208

209-
Use the client session token you generated earlier to bootstrap the Seam SDK on the device. Under the hood, this will set up credential synchronization and start a background sync loop to keep permissions up to date.
209+
Use the client session token you generated earlier to bootstrap the Seam SDK on the device. Under the hood, this will set up credential synchronization and start a background sync loop to keep credentials up to date.
210210

211211

212212
### Initialization and Error Handling
@@ -247,16 +247,13 @@ import SeamSDK
247247
Task {
248248
do {
249249
// Bootstrap the SDK with the CST from your login flow
250-
try SeamSDKManager.initialize(clientSessionToken: token)
250+
try Seam.initialize(clientSessionToken: token)
251251
// Start credential sync and background polling
252-
try await SeamSDKManager.shared.activate()
252+
try await Seam.shared.activate()
253253
print("Seam SDK is now active")
254-
} catch let error as SeamSDKV2Error {
255-
// Handle SDK-specific initialization errors (invalid token, workspace issues)
254+
} catch let error as SeamError {
255+
// Handle SDK-specific initialization errors (invalid token, etc)
256256
showAlert(title: "Initialization Failed", message: error.localizedDescription)
257-
} catch {
258-
// Handle any other errors (network, unexpected)
259-
showAlert(title: "Unexpected Error", message: error.localizedDescription)
260257
}
261258
}
262259
```
@@ -275,7 +272,7 @@ import Combine
275272
private var credentialErrorsCancellable: AnyCancellable?
276273

277274
func startMonitoringCredentialErrors() {
278-
credentialErrorsCancellable = SeamSDKManager.shared.$credentials
275+
credentialErrorsCancellable = Seam.shared.$credentials
279276
.sink { credentials in
280277
for credential in credentials where !credential.errors.isEmpty {
281278
print("Errors for \(credential.displayName):", credential.errors)
@@ -286,15 +283,17 @@ func startMonitoringCredentialErrors() {
286283

287284
#### Credential Error Types
288285

289-
- `awaitingLocalCredential`: Credential is being prepared locally.
290-
- `expired`: Credential has expired and cannot be used.
291-
- `userInteractionRequired(action)`: Additional user interaction required; check the `action` for specifics.
292-
- `unknown`: An unspecified error occurred.
286+
- `awaitingLocalCredential`: The system is waiting for a local credential to become available.
287+
- `expired`: The credential has expired and is no longer valid.
288+
- `userInteractionRequired(action)`: User interaction is required to resolve the credential issue; check the action for specifics.
289+
- `contactSeamSupport`: Configuration error requiring developer attention.
290+
- `unsupportedDevice`: The current device is not supported.
291+
- `unknown`: An unclassified or unexpected credential error occurred.
293292

294293
#### Possible `userInteractionRequired` Actions
295294

296-
- `completeOtpAuthorization(otpUrl:)`: User must complete OTP authorization.
297-
- `enableInternet`: User must enable internet connectivity.
298-
- `enableBluetooth`: User must enable Bluetooth.
299-
- `grantBluetoothPermission`: User must grant Bluetooth permission.
300-
- `appRestartRequired`: User must restart the app.
295+
- `completeOtpAuthorization(otpUrl:)`: The user must complete OTP authorization via the provided URL.
296+
- `enableInternet`: The user must enable internet connectivity.
297+
- `enableBluetooth`: The user must enable Bluetooth on the device.
298+
- `grantBluetoothPermission`: The user must grant Bluetooth permission to the app.
299+
- `appRestartRequired`: The user must restart the app to resolve the issue.

docs/capability-guides/mobile-access/mobile-device-sdks/using-unlock-with-tap.md

Lines changed: 27 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,30 @@ description: >-
55

66
# Unlocking
77

8-
Unlocking with SeamSDK uses proximity to communicate credentials to door readers. When a user initiates an unlock, the SDK performs scanning, error handling, and unlock events via `SeamSDKManager.shared.unlock(using:)`.
8+
Unlocking with SeamSDK uses proximity to communicate credentials to door readers. When a user initiates an unlock, the SDK performs scanning, error handling, and unlock events via `Seam.shared.unlock(using:)`.
99

1010
Using this process involves the following steps:
1111

1212
1. Retrieve available mobile credentials.
13-
2. Monitor for permission or credential errors unhandled errors will be thrown as `credentialErrors([SeamSDKCredentialError])`
13+
2. Monitor for permission or credential errors unhandled errors will be thrown as `credentialErrors([SeamCredentialError])`
1414
3. Perform the unlock operation.
1515
4. Handle unlock status events.
16-
5. Cancel the unlock operation when needed.
16+
5. Cancel the unlock operation if needed.
1717

1818
***
1919

2020
## 1. Retrieve Mobile Credentials
2121

22-
Access the current credentials via the published `credentials` array on `SeamSDKManager.shared`:
22+
Access the current credentials via the published `credentials` array on `Seam.shared`:
2323

2424
{% tabs %}
2525
{% tab title="iOS Swift" %}
2626
```swift
2727
// Access credentials
28-
let credentials = SeamSDKManager.shared.credentials
28+
let credentials = Seam.shared.credentials
2929

3030
// Observe updates with Combine
31-
let credentialsSubscription = SeamSDKManager.shared.$credentials
31+
let credentialsSubscription = Seam.shared.$credentials
3232
.sink { creds in
3333
// Update UI with new credentials array
3434
}
@@ -43,7 +43,7 @@ Permission or setup issues appear in each credential’s `errors` property. Obse
4343
{% tabs %}
4444
{% tab title="iOS Swift" %}
4545
```swift
46-
let errorSubscription = SeamSDKManager.shared.$credentials
46+
let errorSubscription = Seam.shared.$credentials
4747
.flatMap { creds in creds.publisher }
4848
.map { $0.errors }
4949
.sink { errors in
@@ -53,30 +53,31 @@ let errorSubscription = SeamSDKManager.shared.$credentials
5353
{% endtab %}
5454
{% endtabs %}
5555

56-
> **Note:** The `.errors` array on credentials represents per-credential issues though some issues may be repeated across several credentials (e.g. bluetooth requirements). SDK- or credential-level errors (such as invalid token or expired credential) are thrown directly by methods like `unlock(using:)` as `SeamSDKV2Error` or `SeamSDKCredentialError` and must be handled via `do/catch`.
56+
> **Note:** The `.errors` array on credentials represents per-credential issues though some issues may be repeated across several credentials (e.g. bluetooth requirements). Seam SDK- or credential-level errors (such as invalid token or expired credential) are thrown directly by `unlock(using:)` as `SeamError` and must be handled via `do/catch`.
5757
5858
## 3. Perform Unlock Operation
5959

60-
The call to `SeamSDKManager.shared.unlock(using:)` may throw:
61-
- `SeamSDKV2Error`: for SDK-level issues (e.g., invalid token, uninitialized SDK).
62-
- `SeamSDKCredentialError`: for credential-specific issues (e.g., expired credential, device not eligible).
60+
The call to `Seam.shared.unlock(using:)` may throw:
61+
- `SeamError`: for SDK-level issues (e.g., invalid token, uninitialized SDK).
62+
- `SeamCredentialError`: for credential-specific issues (e.g., expired credential, device not eligible).
6363
Ensure you wrap the call in `do/catch` to handle these errors.
6464

6565
Use Async/Await or Combine to initiate an unlock with a selected credential:
6666

6767
{% tabs %}
6868
{% tab title="iOS Swift" %}
6969
```swift
70-
let credentialID = credentials.first!.id
70+
let credentialId = credentials.first!.id
7171

7272
// Async/Await example
7373
Task {
7474
do {
75-
for try await event in SeamSDKManager.shared.unlock(using: credentialID) {
75+
for try await event in try Seam.shared.unlock(using: credentialId).values {
7676
switch event {
7777
case .grantedAccess:
7878
// The lock granted access—show a success indicator.
7979
default:
80+
print("Unlock event: \(event)")
8081
// Access wasn't granted, inform the user and offer retry.
8182
}
8283
}
@@ -88,26 +89,25 @@ Task {
8889

8990
// Combine example
9091
do {
91-
let unlockPublisher = try SeamSDKManager.shared.unlock(using: credentialID)
92+
let unlockPublisher = try Seam.shared.unlock(using: credentialId)
9293
let unlockSubscription = unlockPublisher.sink(
93-
receiveCompletion: { completion in
94-
if case .failure(let error) = completion {
95-
// Show unlock error UI, e.g., "Unlock failed: \(error)"
96-
}
94+
receiveCompletion: { _ in
95+
// Unlock completed.
9796
},
9897
receiveValue: { event in
9998
switch event {
10099
case .grantedAccess:
101100
// The lock granted access—show a success indicator.
102101
default:
103102
// Access wasn't granted, inform the user and offer retry.
103+
print("Unlock event: \(event)")
104104
}
105105
}
106106
)
107-
// Retain `unlockSubscription` as needed
107+
// Retain `unlockSubscription`; discarding it will cancel the unlock attempt.
108108
} catch {
109109
// Handle unlock initialization error
110-
print("Unlock initialization error: \(error)")
110+
print("Unlock error: \(error)")
111111
}
112112
```
113113
{% endtab %}
@@ -119,8 +119,6 @@ Handle each `SeamUnlockEvent` to update your UI and logic. Available events:
119119

120120
- **launched**
121121
Unlock operation has started.
122-
- **connected**
123-
Connection to the lock hardware was successful.
124122
- **grantedAccess**
125123
Access was granted by the lock.
126124
- **timedOut**
@@ -136,12 +134,10 @@ Async/Await example:
136134
```swift
137135
Task {
138136
do {
139-
for try await event in SeamSDKManager.shared.unlock(using: credentialID) {
137+
for try await event in Seam.shared.unlock(using: credentialID) {
140138
switch event {
141139
case .launched:
142140
// Show scanning indicator
143-
case .connected:
144-
// Show connected indicator
145141
case .grantedAccess:
146142
// Show access granted
147143
case .timedOut:
@@ -160,28 +156,24 @@ Combine example:
160156

161157
```swift
162158
do {
163-
let unlockPublisher = try SeamSDKManager.shared.unlock(using: credentialID)
159+
let unlockPublisher = try Seam.shared.unlock(using: credentialID)
164160
let unlockSubscription = unlockPublisher
165161
.receive(on: RunLoop.main)
166162
.sink(
167-
receiveCompletion: { completion in
168-
if case .failure(let error) = completion {
169-
// Show unlock error UI, e.g., "Unlock failed: \(error)"
170-
}
163+
receiveCompletion: { _ in
164+
// unlock completed.
171165
},
172166
receiveValue: { event in
173167
switch event {
168+
case .launched:
169+
// Show scanning indicator.
174170
case .grantedAccess:
175171
// Show success indicator.
176-
case .retry:
177-
// Retry scanning or credential presentation.
178-
case .deniedAccess:
179-
// Access denied—inform the user.
180172
case .timedOut:
181173
// Operation timed out—offer retry.
182174
case .connectionFailed(let debugDescription):
183175
// Show debugDescription details.
184-
}
176+
}
185177
}
186178
)
187179
// Retain `unlockSubscription` as a property and cancel when appropriate (e.g., in deinit or viewWillDisappear).

0 commit comments

Comments
 (0)