signInWithPhoneNumber method

Future<ConfirmationResult> signInWithPhoneNumber(
  1. String phoneNumber,
  2. ApplicationVerifier<ApplicationVerifierJsImpl> applicationVerifier
)

Asynchronously signs in using a phone number in E.164 format (e.g. +16505550101).

This method sends a code via SMS to the given phone number, and returns a ConfirmationResult. After the user provides the code sent to their phone, call ConfirmationResult.confirm with the code to sign the user in.

For abuse prevention, this method also requires a ApplicationVerifier. The Firebase Auth SDK includes a reCAPTCHA-based implementation, RecaptchaVerifier.

Implementation

Future<ConfirmationResult> signInWithPhoneNumber(
        String phoneNumber, ApplicationVerifier applicationVerifier) =>
    handleThenable(jsObject.signInWithPhoneNumber(
            phoneNumber, applicationVerifier.jsObject))
        .then((c) => ConfirmationResult.fromJsObject(c));