fetchDevices method

  1. @override
Future<List<CognitoDevice>> fetchDevices()

Retrieves all tracked devices for the current user.

Implementation

@override
Future<List<CognitoDevice>> fetchDevices() async {
  try {
    final devicesJson = await _channel.invokeListMethod<Map>('fetchDevices');
    return devicesJson?.map((e) => CognitoDevice.fromJson(e)).toList() ?? [];
  } on PlatformException catch (e) {
    throw transformDeviceException(e);
  }
}