baumblatt / capacitor-firebase-auth

Capacitor Firebase Authentication Plugin
MIT License
261 stars 129 forks source link

PhoneProvider consistency between IOS and Android #155

Open jdordoigne opened 3 years ago

jdordoigne commented 3 years ago

Today in IOS the verification code is not sent in the signIn callback. This means that the user is not authenticated on javascript and allow the user to link to an existing account or sign in (like example). In android we can have the validation code, and it will directly signIn the user and cancel the possibility to link phone number with an existing account.

To keep consistency between ios and android we should send the same information / do the same thing.

As this is a breaking changes it could be added in v3 if you are ok with this.

baumblatt commented 3 years ago

Hi, @jdordoigne ,

In my opinion the feature of SignIn on Android without the user enter de verification code is wonderful, this was not implemented on iOS, because the Firebase SDK can't read the verification code automatic.

But I understand you requirement and we can implement this behavior using a flag in configuration or parameter in the call.

I will take a look on this, but I think that the best option is handle everything on web tier without changes on java code.

Finally, please, in case you try to review your implementation, please use the next branch for merges.

Best regards.

jdordoigne commented 3 years ago

Hi and thanks for the feedback ! I was focus on the native side and not on the client. I dig up the code and indeed we could use a flag on js side that won’t break existing behavior.

You can still automatically login the user as cfaSignInPhoneOnCodeReceived is called for this purpose.

Noted for the branch my bad !

nelson6e65 commented 3 years ago

There is a way to skip the "auto-detection" from javascript facades? I call cfaSignInPhone() but never completes on Android, nor fails. I want to be able to use testing phone numbers too.

There is a way to "We sent the sms" instead of "We are waiting to detect phone number" on Android? Thanks in advance.