I'm not sure if this is a RNFirebase or a Firebase issue, but I figured I could start here :)
I just integrated Firebase phone auth into our React Native app, and when testing with my colleagues located in France we're experiencing the following error when validating the SMS code:
Error: The sms code has expired. Please re-send the verification code to try again.
The interesting thing is that we tried different combinations:
So something timezone related seems to be happening there. Any ideas?
Note: We only tested this on Android, they're trying to get an iOS device over there so that we can try to reproduce on it as well.
@gvillenave Without wanting to shirk responsibility, I'm afraid to say that we have no control over this and it's going to be something going on in the underlying SDK... We're just reporting the errors that we get back from the SDKs. Probably best that you report it to Firebase.
I'm going to close this, but do let us know what they say, and re-open if they try and push it back on us!!
Thanks, that's what I thought! I opened an issue with Firebase and I will report back here with what they say.
im also facing this issue but in India.. The code sent is getting expired immediately
@rajeshzmoke could you also open an issue with Firebase support (https://firebase.google.com/support/contact/troubleshooting/)? Hopefully with more reports we can get the ball rolling on a fix sooner.
Hey, guys.
We've faced this problem too.
Looks like it happens only on android, because on iOS everything works fine.
@galikvalkin Thanks for the info, that's what I suspected. Out of curiosity, which country did you have the issue with, and did you open a ticket with Firebase support? I'm trying to gather as much data as I can to send them.
@gvillenave
We've opened ticket on Firebase support.
Country: Ukraine.
Hi guys, any update on this? We are facing the same problem with Firebase too.
I have the same issue on android, on ios all works well. The sms code has expired....
@niocncn yes if you are manually entering the sms code it'll give you that error... i think ive already explained in some other thread about this..will do it here again..
On Android there is something called Auto Verification from firebase when you're using onAuthStateChanged() listener. so whatever logic you have after the sms code is entered put that inside the listener.
i have same issue.. and i notice that it sometimes authenticate in only after i move app to background, and sometimes immediately did any one found working solution ?
Had this same issue too, I'm from Indonesia.
I had this issue today, and I've been looking at the following documentation page:
https://firebase.google.com/docs/auth/web/phone-auth#sign-in-the-user-with-the-verification-code
The page explains how to do sms code verification with different way rather than calling confirm(verificationCode), so I did a workaround for this issue to confirm sms code entered by user by saving confirmation result from signInWithPhoneNumber and doing below:
let credential = firebase.auth.PhoneAuthProvider.credential(confirmation.verificationId, verification);
firebase.auth().signInWithCredential(credential).then((auth) => {
console.log(auth)
}).catch(err => { console.log(err)})
@0x01Brain That worked like a charm. Thanks!
Most helpful comment
I had this issue today, and I've been looking at the following documentation page:
https://firebase.google.com/docs/auth/web/phone-auth#sign-in-the-user-with-the-verification-code
The page explains how to do sms code verification with different way rather than calling confirm(verificationCode), so I did a workaround for this issue to confirm sms code entered by user by saving confirmation result from signInWithPhoneNumber and doing below: