getCredentialState method

  1. @override
Future<CredentialState> getCredentialState(
  1. String userIdentifier
)
override

Implementation

@override
Future<CredentialState> getCredentialState(
  String userIdentifier,
) async {
  if (!Platform.isIOS &&
      !Platform.isMacOS &&
      Platform.environment['FLUTTER_TEST'] != 'true') {
    throw const SignInWithAppleNotSupportedException(
      message: 'The current platform is not supported',
    );
  }

  try {
    return parseCredentialState(
      await _channel.invokeMethod<String>(
        'getCredentialState',
        <String, String>{'userIdentifier': userIdentifier},
      ),
    );
  } on PlatformException catch (exception) {
    throw SignInWithAppleException.fromPlatformException(exception);
  }
}