菜鸟教程小白 发表于 2022-12-11 19:49:44

ios - React-Native Firebase Phone Auth 卡住 iPhone


                                            <p><p>我想在 react-native 中通过 phoneNumber 让用户登录。在 Android 上,此代码片段运行良好。但是在 iOS 上,当我启动此功能时,模拟器总是卡住。我正在尝试使用此代码 <a href="https://rnfirebase.io/docs/v3.3.x/auth/phone-auth" rel="noreferrer noopener nofollow">Auth-Example</a>我正在使用 react-native-firebase 库。</p>

<pre><code>openPhoneVerification() {
    firebase
      .auth()
      .signInWithPhoneNumber(this.state.phoneNumber)
      .then(confirmResult =&gt;
      this.props.navigation.navigate(&#34;PhoneVerification&#34;, {
          confirmResult
      })
      )
      // Wrong number - https://firebase.google.com/docs/reference/js/firebase.auth.Auth#signInWithPhoneNumber
      .catch(error =&gt;
      Alert.alert(
          &#34;Number not valid&#34;,
          &#34;Please check your number and type in again&#34;,
          [
            {
            text: &#34;OK&#34;,
            style: &#34;cancel&#34;
            }
          ],
          { cancelable: true }
      )
      );
}
</code></pre></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>遇到相同问题的任何人的解决方案:</p>

<p>确保为您的 APN 指定的名称与应用名称匹配</p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - React-Native Firebase Phone Auth 卡住 iPhone,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/49136308/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/49136308/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - React-Native Firebase Phone Auth 卡住 iPhone