File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed
src/pages/[platform]/build-a-backend/auth/manage-users/manage-devices Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -270,7 +270,7 @@ func forgetDevice() async {
270
270
print (" Forget device failed with error \( error ) " )
271
271
} catch {
272
272
print (" Unexpected error: \( error ) " )
273
- }
273
+ }
274
274
}
275
275
```
276
276
@@ -326,6 +326,8 @@ Future<void> fetchAllDevices() async {
326
326
```
327
327
328
328
</InlineFilter >
329
+
330
+
329
331
<InlineFilter filters = { [" android" ]} >
330
332
331
333
<BlockSwitcher >
@@ -426,6 +428,25 @@ func fetchDevices() -> AnyCancellable {
426
428
427
429
</InlineFilter >
428
430
431
+ <InlineFilter filters = { [" flutter" ]} >
432
+
433
+ ## Fetch the current device
434
+
435
+ You can fetch the current device by using the following:
436
+
437
+ ``` dart
438
+ Future<void> fetchCurrentUserDevice() async {
439
+ try {
440
+ final device = await Amplify.Auth.fetchCurrentDevice();
441
+ safePrint('Device: $device');
442
+ } on AuthException catch (e) {
443
+ safePrint('Get current device failed with error: $e');
444
+ }
445
+ }
446
+ ```
447
+
448
+ </InlineFilter >
449
+
429
450
You can now set up devices to be remembered, forgotten, and fetched.
430
451
431
452
{ /* user agents */ }
You can’t perform that action at this time.
0 commit comments