React-native-firebase电话身份验证

时间:2019-08-15 20:49:00

标签: react-native react-native-firebase

我目前正在使用react-native-firebase / auth进行电话身份验证 我已经链接了所有内容并执行了所有步骤,但是在提供确认代码并运行模块提供的确认功能时出现此错误。

TypeError: Cannot read property 'native' of undefined
at confirm (ConfirmationResult.js:25)

这是引发错误的代码

    const { confirm } = await auth().signInWithPhoneNumber(`+1 ${number}`)
    confirm('123456')

1 个答案:

答案 0 :(得分:1)

现在,您将获得const中的结果值。返回的值不是函数。

您可以使用此代码

signIn = async () => {
    const { phoneNumber } = this.state;
  const confirm = await firebase.auth().signInWithPhoneNumber(phoneNumber)
  console.log(confirm);

}