logInWithAppleWeb method

Future<void> logInWithAppleWeb()

Starts the Sign In with Apple Flow.

Throws a LogInWithGoogleFailure if an exception occurs.

Implementation

Future<void> logInWithAppleWeb() async {
  try {
    // Create and configure an OAuthProvider for Sign In with Apple.
    final provider = OAuthProvider('apple.com')
      ..addScope('email')
      ..addScope('name');

    // Sign in the user with Firebase.
    await _firebaseAuth.signInWithPopup(provider);
  } on FirebaseAuthException catch (e) {
    throw LogInWithGoogleFailure.fromCode(e.code);
  } catch (e) {
    throw const LogInWithGoogleFailure();
  }
}