Skip to content

Commit 659f945

Browse files
diegodobelogitbook-bot
authored andcommitted
GITBOOK-677: Diego's Oct 20 changes
1 parent b1ae3cf commit 659f945

File tree

2 files changed

+20
-18
lines changed

2 files changed

+20
-18
lines changed

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

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,37 @@ The mobile SDK surfaces missing or required system permissions (Bluetooth, inter
55
## Monitoring Permission Errors
66

77
{% tabs %}
8-
98
{% tab title="Android Kotlin" %}
109
```kotlin
1110
coroutineScope.launch {
1211
SeamSDK.getInstance().credentials.collect { credentialsList ->
1312
val errors = credentialsList.flatMap { it.errors }
1413
errors.forEach { error ->
1514
when (error) {
16-
is SeamCredentialError.Expired -> { /* handle credential expiration error */}
17-
is SeamCredentialError.Loading -> { /* handle not loaded yet */ }
18-
is SeamCredentialError.Unknown -> { /* handle unknown error */}
1915
is SeamCredentialError.UserInteractionRequired -> {
2016
handleUserInteractionRequired(error.interaction)
2117
}
18+
else -> { /* handle other errors */ }
19+
}
20+
}
21+
}
22+
23+
fun handleUserInteractionRequired(interaction: SeamRequiredUserInteraction) {
24+
when (interaction) {
25+
is SeamRequiredUserInteraction.GrantPermissions -> {
26+
/* handle permissions error */
27+
// interaction.permissions contains the list of required permissions
2228
}
29+
else -> { /* handle other errors */ }
2330
}
2431
}
2532
}
2633
```
2734
{% endtab %}
2835

2936
{% tab title="iOS Swift" %}
30-
3137
Use Combine to watch the published credentials array and handle permission-related errors:
3238

33-
3439
```swift
3540
import SeamSDK
3641
import Combine
@@ -54,15 +59,13 @@ func startMonitoringPermissionErrors() {
5459
{% endtab %}
5560
{% endtabs %}
5661

57-
5862
The mobile SDK automatically clears resolved permission errors once the required permission is granted, reflecting the updated credential state.
5963

6064
## Handling Permission Actions
6165

6266
Implement your handler for each action:
6367

6468
{% tabs %}
65-
6669
{% tab title="Android Kotlin" %}
6770
```kotlin
6871
fun handleUserInteractionRequired(interaction: SeamRequiredUserInteraction) {
@@ -92,7 +95,6 @@ func handlePermissionAction(_ action: CredentialUserAction) {
9295
{% endtab %}
9396
{% endtabs %}
9497

95-
9698
## See also
9799

98100
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.

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,15 @@ coroutineScope.launch {
339339
Stop scanning by canceling your active task or subscription.
340340

341341
{% tabs %}
342+
{% tab title="iOS Swift" %}
343+
```swift
344+
// For Combine
345+
unlockSubscription.cancel()
346+
347+
// For Async/Await, cancel the Task as needed.
348+
```
349+
{% endtab %}
350+
342351
{% tab title="Android Kotlin" %}
343352
```kotlin
344353
val seamSDK = SeamSDK.getInstance()
@@ -352,13 +361,4 @@ val job = seamSDK.unlock(
352361
job.cancel()
353362
```
354363
{% endtab %}
355-
356-
{% tab title="iOS Swift" %}
357-
```swift
358-
// For Combine
359-
unlockSubscription.cancel()
360-
361-
// For Async/Await, cancel the Task as needed.
362-
```
363-
{% endtab %}
364364
{% endtabs %}

0 commit comments

Comments
 (0)