You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/capability-guides/mobile-access/mobile-device-sdks/handling-system-permissions.md
+41-3Lines changed: 41 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,40 @@
1
1
# Handling System Permissions
2
2
3
-
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.
3
+
The mobile SDK surfaces missing or required system permissions (Bluetooth, internet connectivity, and so on) as `CredentialError.userInteractionRequired(action)` entries in each credential’s `errors` array. After activation, observe these errors and handle the specified actions. Errors update automatically as requirements change.
For a complete SwiftUI-based implementation of credential error handling for iOS, see the `SeamUnlockCardView` in the SeamComponents library, which demonstrates observing credential errors and updating the UI accordingly.
98
+
For a complete SwiftUI-based implementation of credential error handling for iOS, see `SeamUnlockCardView` in the SeamComponents library, which demonstrates observing credential errors and updating the UI accordingly.
## 4. Initialize the Mobile SDK with the Client Session Token
207
207
208
208
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.
210
-
209
+
Use the client session token that you generated earlier to bootstrap the Seam SDK on the device. Under the hood, this action sets up credential synchronization and starts a background sync loop to keep permissions up to date.
211
210
212
211
### Initialization and Error Handling
213
212
214
-
Perform initialization and activation within your app’s asynchronous context (e.g., Swift’s `Task` or Kotlin coroutines) so you can handle errors. The initialization call may fail due to configuration issues (such as an invalid token), and the activation call may fail due to network or runtime errors. Catch these errors and present a user-friendly message or fallback UI as appropriate.
213
+
Perform initialization and activation within your app’s asynchronous context (for example, Swift’s `Task` or Kotlin coroutines) so that you can handle errors. The initialization call may fail due to configuration issues (such as an invalid token), and the activation call may fail due to network or runtime errors. Catch these errors and present a user-friendly message or fallback UI as appropriate.
215
214
216
215
{% tabs %}
217
216
{% tab title="Android Kotlin" %}
@@ -243,16 +242,16 @@ try {
243
242
```swift
244
243
importSeamSDK
245
244
246
-
// Initialize the Mobile SDK with the Client Session Token (CST)
245
+
// Initialize the Mobile SDK with the client session token (CST).
247
246
Task {
248
247
do {
249
-
// Bootstrap the SDK with the CST from your login flow
248
+
// Bootstrap the SDK with the CST from your login flow.
Any errors that occur between activation and deactivation surface on individual credential objects via their `errors` property. Observe the `credentials` array to detect and handle these errors:
265
+
Any errors that occur between activation and deactivation surface on individual credential objects through their `errors` property. Observe the `credentials` array to detect and handle these errors:
Copy file name to clipboardExpand all lines: docs/capability-guides/mobile-access/mobile-device-sdks/using-unlock-with-tap.md
+30-21Lines changed: 30 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,12 +5,12 @@ description: >-
5
5
6
6
# Unlocking
7
7
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:)`.
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 using`Seam.shared.unlock(using:)`.
9
9
10
10
Using this process involves the following steps:
11
11
12
12
1. Retrieve available mobile credentials.
13
-
2. Monitor for permission or credential errors unhandled errors will be thrown as `credentialErrors([SeamCredentialError])`
13
+
2. Monitor for permission or credential errors. Unhandled errors are thrown as `credentialErrors([SeamCredentialError])`.
14
14
3. Perform the unlock operation.
15
15
4. Handle unlock status events.
16
16
5. Cancel the unlock operation if needed.
@@ -19,18 +19,21 @@ Using this process involves the following steps:
19
19
20
20
## 1. Retrieve Mobile Credentials
21
21
22
-
Access the current credentials via the published `credentials` array on `Seam.shared`:
22
+
Access the current credentials through the published `credentials` array on `Seam.shared`:
23
23
24
24
{% tabs %}
25
25
{% tab title="iOS Swift" %}
26
26
```swift
27
+
importSeamSDK
28
+
importCombine
29
+
27
30
// Access credentials
28
31
let credentials = Seam.shared.credentials
29
32
30
33
// Observe updates with Combine
31
34
let credentialsSubscription = Seam.shared.$credentials
32
35
.sink { creds in
33
-
// Update UI with new credentials array
36
+
// Update UI with new credentials array.
34
37
}
35
38
```
36
39
{% endtab %}
@@ -43,30 +46,36 @@ Permission or setup issues appear in each credential’s `errors` property. Obse
43
46
{% tabs %}
44
47
{% tab title="iOS Swift" %}
45
48
```swift
49
+
importSeamSDK
50
+
importCombine
51
+
46
52
let errorSubscription = Seam.shared.$credentials
47
53
.flatMap { creds in creds.publisher }
48
54
.map { $0.errors }
49
55
.sink { errors in
50
-
// Handle errors, e.g. `.userInteractionRequired`, `.expired`, etc.
56
+
// Handle errors, for example, `.userInteractionRequired`, `.expired`, etc.
51
57
}
52
58
```
53
59
{% endtab %}
54
60
{% endtabs %}
55
61
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`.
62
+
> **Note:** The `.errors` array on credentials represents per-credential issues, though some issues may be repeated across several credentials (for example, bluetooth requirements). SDK- or credential-level errors (such as invalid token or expired credential) are thrown directly by methods like `unlock(using:)`because`SeamError`or `SeamCredentialError`and must be handled through`do/catch`.
57
63
58
64
## 3. Perform Unlock Operation
59
65
60
66
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).
63
-
Ensure you wrap the call in `do/catch` to handle these errors.
67
+
-`SeamError`: For SDK-level issues (for example, invalid token, uninitialized SDK).
68
+
-`SeamCredentialError`: For credential-specific issues (for example, expired credential, device not eligible).
69
+
Ensure that you wrap the call in `do/catch` blocks to handle these errors.
64
70
65
71
Use Async/Await or Combine to initiate an unlock with a selected credential:
0 commit comments