Firebase phoneAuth在生产版本中出现错误

时间:2019-06-27 11:36:19

标签: android firebase firebase-authentication react-native-firebase

我正在使用react-native-firebase 5.0 Firebase phoneAuth在开发版本中运行良好,但是当我登录apk时,firebase.auth()。signInWithPhoneNumber(phoneNumber)始终运行catch方法。

  

但是测试电话号码可以正常工作

这里是此模块的代码。

export const signInWithPhone = (phoneNumber) => {
return (dispatch) => {
    firebase.auth()
        .signInWithPhoneNumber(phoneNumber)
        .then((confirmResult) => {
            dispatch({
                type: 'SIGN_IN_WITH_PHONE',
                payload: confirmResult,
                phoneNumber
            })
        })
        .catch((error) => {
            dispatch({
                type: 'INVALID_PHONE_NUMBER',
            })
        })

    }
}

这是日志行为上的错误消息 here is the error message in the log cat

这是屏幕。用户按下“提交”按钮时,电话号码中会添加+92。 here is the screen. +92 is added in the phone number when the user presses the submit button.

2 个答案:

答案 0 :(得分:0)

最好输入包含国家/地区代码的电话号码,例如+923211234567

答案 1 :(得分:0)

当我制作了我的App的签名APK时,所以我没有添加SHA1密钥以在Firebase控制台中发布。添加此功能可以解决此问题。 感谢您的回答#Ovais先生

相关问题