signInWithPhoneNumber() is not working in react-native

瘦欲@ 提交于 2019-12-20 07:08:48

问题


hi I am geeting this error in

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}

in RNFirebaseAuth.m.

here is error

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'

回答1:


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



来源:https://stackoverflow.com/questions/57986052/signinwithphonenumber-is-not-working-in-react-native

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!