fetchAuthSession method

  1. @override
Future<AuthSession> fetchAuthSession({
  1. AuthSessionRequest? request,
})

Implementation

@override
Future<AuthSession> fetchAuthSession({AuthSessionRequest? request}) async {
  try {
    final Map<String, dynamic>? data =
        (await (_channel.invokeMapMethod<String, dynamic>(
      'fetchAuthSession',
      <String, dynamic>{
        'data': request != null ? request.serializeAsMap() : {},
      },
    )));
    if (data == null)
      throw AmplifyException(
          AmplifyExceptionMessages.nullReturnedFromMethodChannel);
    return _formatSessionResponse(data);
  } on PlatformException catch (e) {
    throw castAndReturnPlatformException(e);
  }
}