使用Firebase验证React Native中的电话号码?

时间:2017-12-10 18:49:34

标签: firebase react-native firebase-authentication

我认为在firebase version 3.0.0电话后,Auth会被整合。但是,我不断收到firebase.auth().verifyPhoneNumber()不是函数(Node.js)的错误。我目前正在使用react native,这意味着我正在使用Web API。有谁知道如何从这里开始?

  • “firebase”:“^ 4.8.0”,
编辑:我正在实施Facebook,谷歌和电子邮件作为登录方式。但是,我的应用程序要求用户验证他/她的电话号码。我在文档中看到的是如何通过短信签名,但没有验证。

提前致谢!

1 个答案:

答案 0 :(得分:1)

当您signInWithPhoneNumber时,您实际上是在验证用户的电话号码。您可以使用Facebook / Google登录,然后linkWithPhoneNumber / updateWithPhoneNumber登录currentUser。这将更新用户的电话号码并验证所有权。自版本4.x.x起,Firebase支持电话号码身份验证。顺便说一下,这对于本地反应来说并不开箱即用。您需要使用类似的方法:Ionic2 authentication firebase