second argument applicationverifier must be an implementation of firebase.auth.applicationverifier

 .auth()
  .signInWithPhoneNumber(phoneNumber, appVerifier)
  .then(function(confirmationResult) {
    // SMS sent. Prompt user to type the code from the message, then sign the
    // user in with confirmationResult.confirm(code).
    window.confirmationResult = confirmationResult;
    //
    alert("SMS sent");
  })
  .catch(function(error) {
    // Error; SMS not sent
    // ...
    alert("Error ! SMS not sent");
  });



 initReCaptcha() {
setTimeout(() => {
  let vm = this;
  window.recaptchaVerifier = new firebase.auth.RecaptchaVerifier(
    "recaptcha-container",
    {
      size: "invisible",
      callback: function(response) {
        // reCAPTCHA solved, allow signInWithPhoneNumber.
        // ...
      },
      "expired-callback": function() {
        // Response expired. Ask user to solve reCAPTCHA again.
        // ...
      }
    }
  );
  //
  this.appVerifier = window.recaptchaVerifier;
}, 1000);
}

created() {
  this.initReCaptcha();
}

i set app verifier as second argument but it generate error what should i do

0 Answers