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 {
270270 print (" Forget device failed with error \( error ) " )
271271 } catch {
272272 print (" Unexpected error: \( error ) " )
273- }
273+ }
274274}
275275```
276276
@@ -326,6 +326,8 @@ Future<void> fetchAllDevices() async {
326326```
327327
328328</InlineFilter >
329+
330+
329331<InlineFilter filters = { [" android" ]} >
330332
331333<BlockSwitcher >
@@ -426,6 +428,25 @@ func fetchDevices() -> AnyCancellable {
426428
427429</InlineFilter >
428430
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+
429450You can now set up devices to be remembered, forgotten, and fetched.
430451
431452{ /* user agents */ }
You can’t perform that action at this time.
0 commit comments