简体   繁体   English

使用电话号码登录验证失败

[英]signinwithphonenumber authentication failed

I am getting我正进入(状态

SigninwithPhoneNumber failed: expected 2 arguments but got 1 SigninwithPhoneNumber 失败:预期有 2 个参数,但得到 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.您应该为 signInWithPhoneNumber 方法提供两个参数。 In the Firebase docs here .此处的 Firebase 文档中。 You need to be providing a phone number and an app verifier.您需要提供电话号码和应用验证程序。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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