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')
解决方案
现在你在 const 中得到了结果值。返回的值不是函数。
您可以使用此代码
signIn = async () => {
const { phoneNumber } = this.state;
const confirm = await firebase.auth().signInWithPhoneNumber(phoneNumber)
console.log(confirm);
}
推荐阅读
- javascript - 如何判断 Vue 组件是否处于活动状态
- python - 在 Django 模型中重构表
- nlp - 如何计算出序列中下一个最可能的字母,自然语言处理
- c - 如果所有条件都为真,则做某事
- spring-boot - java spring boot 应用程序无法将 zipkin 跟踪信息传递给 rabbitmq
- python - PyKafka 元数据以字节而不是字符串为单位
- highcharts - HighCharts 的不同间隔
- javascript - 在 Redux 中状态更改后,React 组件不会重新渲染
- python - PyLint,XLSXWriter 错误:方法调用中的参数“last_col”没有值 merge_range()
- swift - 子 UIViewController 中的 resignFirstResponder