auth().signInWithPhoneNumber() not working for react-native

Viewed 600

I am using react-native to build an android app while authentication is done using firebase. I am using the following libraries :

@react-native-firebase/app
@react-native-firebase/auth

The authentication is working perfectly fine for signInWithEmailAndPassword() but not with the phone no :

The below is the function :

signInWithPhoneNumber = () => {
        auth().signInWithPhoneNumber('+91 1234 567 890')
            .then(confirmationResult => {
                this.setState({
                    confirm: confirmationResult
                })
            })
            .catch(function (error) {
                console.error(error);
            });
    }

It's not going into the .then() and my screen for the emulator is getting stuck with blank black screen.

enter image description here

1 Answers

UPDATE (May 20, 2021)

Seems line the issue is fixed in the latest version.


This is a known issue in the firebase phone auth sdk. Ref: https://github.com/firebase/firebase-android-sdk/issues/2164

Until Google fixes it, add the following line in your build.gradle

implementation "androidx.browser:browser:1.2.0"
Related