Skip to content

Commit 49d4768

Browse files
authored
Deprecating PhoneAuthProvider::kMaxTimeoutMs (#1084)
* Deprecate `PhoneAuthProvider::kMaxTimeoutMs` This is a read-only valued used to set the upper bound for `auto_verify_time_out_ms`. However, the value was set too low and Android SDK has increase the range to 30 to 120 seconds, while iOS SDK does not have a way to override timeout. This is a change to deprecate this public property so that the underlying SDK can govern the range for timeout. The property is still accessible but has no effect at all.
1 parent 1d8853b commit 49d4768

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

auth/src/android/credential_android.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -814,8 +814,7 @@ void PhoneAuthProvider::VerifyPhoneNumber(
814814
jstring j_phone_number = env->NewStringUTF(phone_number);
815815
jobject j_milliseconds = env->GetStaticObjectField(
816816
timeunit::GetClass(), timeunit::GetFieldId(timeunit::kMilliseconds));
817-
jlong j_time_out =
818-
static_cast<jlong>(std::min(auto_verify_time_out_ms, kMaxTimeoutMs));
817+
jlong j_time_out = static_cast<jlong>(auto_verify_time_out_ms);
819818
jobject j_token = force_resending_token == nullptr
820819
? nullptr
821820
: force_resending_token->data_->token_global_ref();

auth/src/include/firebase/auth/credential.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,12 @@ class PhoneAuthProvider {
524524

525525
/// Maximum value of `auto_verify_time_out_ms` in @ref VerifyPhoneNumber.
526526
/// Larger values will be clamped.
527+
///
528+
/// @deprecated This value is no longer used to clamp
529+
/// `auto_verify_time_out_ms` in @ref VerifyPhoneNumber. The range is
530+
/// determined by the underlying SDK, ex. <a
531+
/// href="/docs/reference/android/com/google/firebase/auth/PhoneAuthOptions.Builder"><code>PhoneAuthOptions.Build</code>
532+
/// in Android SDK</a>
527533
static const uint32_t kMaxTimeoutMs;
528534

529535
/// Start the phone number authentication operation.
@@ -535,7 +541,6 @@ class PhoneAuthProvider {
535541
/// miliseconds. Currently SMS auto retrieval is only supported on Android.
536542
/// If 0, do not do SMS auto retrieval.
537543
/// If positive, try to auto-retrieve the SMS verification code.
538-
/// If larger than kMaxTimeoutMs, clamped to kMaxTimeoutMs.
539544
/// When the time out is exceeded, listener->OnCodeAutoRetrievalTimeOut()
540545
/// is called.
541546
/// @param[in] force_resending_token If NULL, assume this is a new phone

release_build_files/readme.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,10 +634,13 @@ workflow use only during the development of your app, not for publicly shipping
634634
code.
635635

636636
## Release Notes
637-
### Upcoming Release
637+
### Upcoming
638638
- Changes
639639
- General: Remove unused headers for performance and test lab from the
640640
package.
641+
- Auth (Android/iOS): Deprecating `PhoneAuthProvider::kMaxTimeoutMs`. The
642+
actual range is determined by the underlying SDK, ex.
643+
[PhoneAuthOptions.Builder from Android SDK](https://firebase.google.com/docs/reference/android/com/google/firebase/auth/PhoneAuthOptions.Builder).
641644

642645
### 9.6.0
643646
- Changes

0 commit comments

Comments
 (0)