React-native-firebase: Exception calling signInWithPhoneNumber

Created on 14 Jan 2018  路  18Comments  路  Source: invertase/react-native-firebase

phone-auth-source-file.txt

Issue

Exception calling signInWithPhoneNumber (see attached file). This was working until recently and now causes a crash in our Android app.

Exception java.lang.IllegalArgumentException: Cannot create PhoneAuthCredential without either verificationProof, sessionInfo, ortemprary proof.
com.google.android.gms.common.internal.zzbq.checkArgument ()
com.google.firebase.auth.PhoneAuthCredential. ()
com.google.firebase.auth.PhoneAuthProvider.getCredential ()
io.invertase.firebase.auth.RNFirebaseAuth._confirmVerificationCode (RNFirebaseAuth.java:708)
java.lang.reflect.Method.invoke (Method.java)
com.facebook.react.bridge.JavaMethodWrapper.invoke (JavaMethodWrapper.java:363)
com.facebook.react.bridge.JavaModuleWrapper.invoke (JavaModuleWrapper.java:162)
com.facebook.react.bridge.queue.NativeRunnable.run (NativeRunnable.java)
android.os.Handler.handleCallback (Handler.java:739)
android.os.Handler.dispatchMessage (Handler.java:95)
com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage (MessageQueueThreadHandler.java:31)
android.os.Looper.loop (Looper.java:158)

Environment

  1. Application Target Platform: Only happens on Android (iOS works)

  1. Development Operating System: macOS High Sierra 10.13.2

  1. Build Tools: Android Studio 3.0.1

  1. React Native version: 0.48.4

  1. RNFirebase Version: 3.1.1

  1. Firebase Module:
Authentication Waiting for User Response

Most helpful comment

Experiencing this issue on the .confirm call (android only). .signInWithPhoneNumber works fine. react-native: 0.59.3, react-native-firebase: 5.3.1

All 18 comments

@hmolotsi It doesn't look like you're listening for the onAuthStateChanged event to detect Android auto-verified numbers as per: https://rnfirebase.io/docs/v3.2.*/auth/phone-auth#3.-[Android]-Handle-Auto-Verification

Thanks @chrisbianca

@chrisbianca Is listening to onAuthStateChanged the only way to implement this flow on Android? I was under the impression that calling confirm manually should work as well. It's especially an issue for devices like tablets that don't necessarily have a phone number and people use a separate device to authenticate.

Thanks!

I'm definitely listening to onAuthStateChanged but still having this problem.
Only on android, iOS works fine.

React Native 0.55.4
React Native Firebase 4.3.7

@gvillenave verifyPhoneNumber is the one you want for full control over the flow without reliance on onAuthStateChanged. 馃憤

See: https://rnfirebase.io/docs/v4.3.x/auth/phone-auth#verifyPhoneNumber


Loving react-native-firebase and the support we provide? Please consider supporting us with any of the below:

i have also same problem

I've still got this problem on 5.0.0-rc.1, with react-native 0.57.0-rc.3

I'm listening to onAuthStateChanged, and the error occurs when calling confirmationObject.confirm(code)

I'm aware that verifyPhoneNumber exists, but I don't really want or need full control over the flow.
I'm not entirely sure that it would solve the problem anyway, it seems like I would have to call the same problematic function either way.

So it turns out it works fine if I use the android device's own phone number. I was sending the code to my iPhone and inputting it in the android. When using the android's number, it automatically verifies and logs in.

That means android users of my app can't log in with codes from phone numers other than their own. It works fine on iOS.

I am still experiencing this issue. Has anyone found a solution yet? I am definitely listening to onAuthStateChanged. When I reload the app, it logs me in so I am definitely getting logged in as well. However, the app still crashes when I enter the verification code.

I am still facing that problem. does anyone found a proper workaround for this?
React-native: 0.57.5
react-native-firebase: 5.1.1

Experiencing this issue on the .confirm call (android only). .signInWithPhoneNumber works fine. react-native: 0.59.3, react-native-firebase: 5.3.1

@franzwarning - experiencing the same issue with the same dependencies. Any chance you found some sort of resolution? SHA-1 is up, everything seems to be working besides this

any update on this issue

I'm experiencing this issue as well, any chance we can get this reopened? Seems like it could be a problem with Android Firebase: https://github.com/firebase/FirebaseUI-Android/issues/1392

If you get on the latest version this is all resolved. I'm currently on

"@react-native-firebase/app": "^6.0.2"
"@react-native-firebase/auth": "^6.0.2"

can anyone else confirm this getting fixed by upgrading to 6.0.2??

6.0.4 is out now, not sure if it is fixed though

I upgraded to 6.0.3 and I haven't seen this crash yet.

Was this page helpful?
0 / 5 - 0 ratings