简体   繁体   中英

signinwithphonenumber authentication failed

I am getting

SigninwithPhoneNumber failed: expected 2 arguments but got 1

in this code

firebase
  .auth()
  .signInWithPhoneNumber(phoneNumber)
  .then(confirmResult =>
    this.setState({ confirmResult, message: "Code has been sent!" })
  )
  .catch(error =>
    this.setState({
      message: `Sign In With Phone Number Error: ${error.message}`
    })
  );
};

You are supposed to be providing two arguments to the signInWithPhoneNumber method. In the Firebase docs here . You need to be providing a phone number and an app verifier.

firebase
 .auth()
 .signInWithPhoneNumber(phoneNumber, appVerifier)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM