firebase-kotlin-sdk icon indicating copy to clipboard operation
firebase-kotlin-sdk copied to clipboard

Fix android phone authentication

Open CharlesEtieve opened this issue 2 years ago • 1 comments

Current behavior blocks sms code user input until auto retrieval timeout is reached.

Documentation states it is not recommended to enable user input after sms code retrieval timeout, we should rather enable user input after code sent. https://firebase.google.com/docs/auth/android/phone-auth#oncodeautoretrievaltimeoutstring-verificationid

So I moved the getVerificationCode() from onCodeAutoRetrievalTimeOut() to onCodeSent() and it works well on my project.

CharlesEtieve avatar May 20 '22 08:05 CharlesEtieve

Thanks for the PR! And sorry for the delay in reviewing.

What about JS and iOS, do they suffer the same issue?

Hello, sorry for the late reply! I cannot tell you about the other platforms but I guess not. My iOS coworker did not implement authentication with this SDK. It was a little bit too complex with the suspend function inside PhoneVerificationProvider. I will tell you later about that. We do not have a JS app.

CharlesEtieve avatar Aug 07 '22 14:08 CharlesEtieve