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

PhoneAuthProvider doesn't work as expected

Open vfutia opened this issue 11 months ago • 2 comments
trafficstars

Maybe this is a lack of understanding on my part but it doesn't appear that the PhoneAuthProvider works as one would expect. I'm working on a Kotlin Multiplatform project and have created an Android specific implementation of PhoneVerificationProvider and and iOS specific implementation as well. I am triggering calls to PhoneAuthProvider().verifyPhoneNumber() in common code and pass it the PhoneVerificationProvider from the respective platform using expects/actual.

There are two things that don't make sense to me:

  1. On the Android side, there doesn't appear to be any way to actually submit your SMS code to Firebase. In the code, it looks like it's only automatically done for you after the timeout expires. getVerificationCode() is called when the timeout triggers and whatever that returns after the timeout, ready or not, is what gets sent to Firebase. Additionally, there is no way to get access to the verificationId that comes from Firebase so that you can manually trigger a call to credential(). Am I wrong? Is there a way to manually submit the verification code that I'm not seeing?

  2. The iOS interface of PhoneVerificationProvider doesn't make any sense to me and I have no clue how to use it. This interface does not include a timeout. You also have to specific a FIRAuthUIDelegateProtocol and I have no idea what that is or where to get one. It's really unclear how this is supposed to work in the iOS context.

Any help I could get with this would be appreciated!!

vfutia avatar Nov 26 '24 21:11 vfutia

Did anyone solved this or have some hints?

CiprianGabor avatar Feb 09 '25 22:02 CiprianGabor

@Daeda88 @nbransby @michaelprichardson Could you help us on this please?

CiprianGabor avatar Feb 14 '25 14:02 CiprianGabor