ios - signInWithPhoneNumber() 在 react native 中不起作用

标签 ios objective-c firebase react-native react-native-firebase

嗨,我在

中收到此错误
firebase.auth().signInWithPhoneNumber(phoneNumber)

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 中。

enter image description here

这里有错误

enter image description here

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

来自 native 模块的非法回调调用。此回调类型仅允许从 native 代码进行单次调用。

"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的方法不是异步的

关于ios - signInWithPhoneNumber() 在 react native 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57986052/

相关文章:

ios - NSUserDefaults setObject 崩溃

ios - 今天扩展中的视频/音频

javascript - 从 firebase 列表中获取单个项目

java - 从 Firebase 检索多个子节点的数据

javascript - 我想将 JSON 数据传递给与 web View 相关的 javascript 函数。但是我无法从 Javascript 函数中获取响应数据

ios - Swift - 单击按钮后打开新 View

ios - 无法将 UIImageView 拖到 UIScrollview 的末尾?

ios - iOS 中的总屏幕解锁时间计算

iphone - AVQueuePlayer 的预缓冲

javascript - 无法将 “custom blob” 保存到 Firestore - ADMIN SDK