signInWithPhoneNumber method

  1. @override
Future<ConfirmationResultPlatform> signInWithPhoneNumber(
  1. String phoneNumber,
  2. RecaptchaVerifierFactoryPlatform applicationVerifier
)

Starts a sign-in flow for a phone number.

You can optionally provide a RecaptchaVerifier instance to control the reCAPTCHA widget appearance and behavior.

Once the reCAPTCHA verification has completed, called ConfirmationResult.confirm with the users SMS verification code to complete the authentication flow.

This method is only available on web based platforms.

Implementation

@override
Future<ConfirmationResultPlatform> signInWithPhoneNumber(
  String phoneNumber,
  RecaptchaVerifierFactoryPlatform applicationVerifier,
) async {
  // Do not inline - type is not inferred & error is thrown.
  auth_interop.RecaptchaVerifier verifier = applicationVerifier.delegate;

  final confirmationResult = await guardAuthExceptions(
    () => delegate.signInWithPhoneNumber(
      phoneNumber,
      verifier,
    ),
  );
  return ConfirmationResultWeb(
    this,
    confirmationResult,
    _webAuth,
  );
}