authorizeIOSWith method

  1. @override
Future<AuthResult> authorizeIOSWith(
  1. PassageSocialConnection connection
)
override

Implementation

@override
Future<AuthResult> authorizeIOSWith(
    PassageSocialConnection connection) async {
  if (!Platform.isIOS) {
    throw PassageError(
        code: PassageErrorCode.socialAuthError,
        message: 'Only supported on iOS. Use authorizeWith instead.');
  }
  try {
    final jsonString = await methodChannel.invokeMethod<String>(
        'authorizeWith', {'connection': connection.value});
    return AuthResult.fromJson(jsonString!);
  } catch (e) {
    throw PassageError.fromObject(object: e);
  }
}