0
votes

I'm using react-native-firebase 5.0 Firebase phoneAuth is working fine when in development build but when i signed in the apk, the firebase.auth().signInWithPhoneNumber(phoneNumber) always runs the catch method.

But it is working fine for the testing phone number

Here the code for this module.

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 on the log act here is the error message in the log cat

here is the screen. +92 is added in the phone number when the user presses the submit button. here is the screen. +92 is added in the phone number when the user presses the submit button.

2
yes. the number is send like +923*********. the code is working completely when in development buildSardar Usama

2 Answers

0
votes

It is preferred to input phone number containing the country code for example +923211234567

0
votes

As i made the signed APK of my App, so i didn't add the SHA1 key for release in firebase console. Adding this solved this issue. Thanks for your answer Mr. #Ovais