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

Make PhoneAuthProvider.MaxTimeoutMs settable since 3 seconds is too short

Open gisinator opened this issue 4 years ago • 1 comments

When calling .verifyPhoneNumber, I can set a autoVerifyTimeoutMS parameter, which, according to the docs, is clamped to MaxTimeoutMs property of PhoneAuthProvider. This MaxTimeoutMs property is 3 seconds, which is - at least on my two devices - just too short. On both my Android devices it takes about 5 seconds after codeSent until the actual sms is received.

Unfortunately, MaxtimeoutMs is only gettable, not settable. I would like to extend this value to 10 seconds so that I can make use of autoVerification.

Right now my users would have to copy and paste the 6-digit-code into an input field, which could - at least in my eyes - easily "fixed" by allowing to set this autoVerifyTimeout.

Or am I missing something?

FirebaseUnity 8.1.0 Unity 2020.3.16f1

gisinator avatar Sep 07 '21 10:09 gisinator

Seems like it is possible to override timeout in Android SDK and The minimum timeout is 30 seconds, and the maximum timeout is 2 minutes https://firebase.google.com/docs/reference/android/com/google/firebase/auth/PhoneAuthOptions.Builder#public-phoneauthoptions.builder-settimeout-long-timeout,-timeunit-unit

It is unfortunate the cap in C++ SDK is set to 3 seconds. https://github.com/firebase/firebase-cpp-sdk/blob/8f3e19226639a3b91e5d879cdf5f3d867dbf8db4/auth/src/common.cc#L25 https://github.com/firebase/firebase-cpp-sdk/blob/8f3e19226639a3b91e5d879cdf5f3d867dbf8db4/auth/src/android/credential_android.cc#L818

I think this is something we need to update in C++ SDK: we should be able to extend the cap to 120 seconds which is the same to Android SDK.

Let me mark this as a bug now.

chkuang-g avatar Aug 27 '22 02:08 chkuang-g