signInWithPhoneNumber()在本机中不起作用 [英] signInWithPhoneNumber() is not working in react-native

查看:212
本文介绍了signInWithPhoneNumber()在本机中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在

firebase.auth().signInWithPhoneNumber(phoneNumber)

错误域= FIRAuthErrorDomain代码= 17057用户交互仍在进行中,无法显示其他视图. UserInfo = {NSLocalizedDescription =用户交互仍在进行中,无法显示其他视图.FIRAuthErrorUserInfoNameKey = ERROR_WEB_CONTEXT_ALREADY_PRESENTED}

Error Domain=FIRAuthErrorDomain Code=17057 "User interaction is still ongoing, another view cannot be presented." UserInfo={NSLocalizedDescription=User interaction is still ongoing, another view cannot be presented., FIRAuthErrorUserInfoNameKey=ERROR_WEB_CONTEXT_ALREADY_PRESENTED}

在RNFirebaseAuth.m中.

in RNFirebaseAuth.m.

这是错误

const confirmResult = await firebase.auth().signInWithPhoneNumber(phoneNumber);
      if (confirmResult) {
        this.setState({
          confirmResult,
          message: 'Code has been sent!',
          step: 2,
        }, this.goToEnterOtpScreen());
      }

来自本机模块的非法回调调用.此回调类型仅允许从本机代码中进行一次调用.

Illegal callback invocation from native module. This callback type only permits a single invocation from native code.

"react-native-firebase": "^5.5.4",



 pod 'Firebase/Core', '~> 6.3.0'

  pod 'Firebase/Auth', '~> 6.3.0'
  pod 'Firebase/Database', '~> 6.3.0'
  pod 'Firebase/Functions', '~> 6.3.0'
  pod 'Firebase/DynamicLinks', '~> 6.3.0'
  pod 'Firebase/Firestore', '~> 6.3.0'
  pod 'Firebase/Messaging', '~> 6.3.0'
  pod 'Firebase/RemoteConfig', '~> 6.3.0'
  pod 'Firebase/Storage', '~> 6.3.0'
  pod 'Firebase/Performance', '~> 6.3.0'

推荐答案

您调用await的方法似乎不异步

It looks like the method where you are calling await is not async

这篇关于signInWithPhoneNumber()在本机中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆