Stay organized with collections
Save and categorize content based on your preferences.
firebase::auth::PhoneAuthOptions
#include <credential.h>
Options object for configuring phone validation flows in PhoneAuthProvider.
Summary
Public attributes
|
force_resending_token
|
|
phone_number
|
std::string
The phone number for sign-in, sign-up, or second factor enrollment.
|
timeout_milliseconds
|
uint32_t
The maximum amount of time you’re willing to wait for SMS auto-retrieval to be completed by the SDK.
|
ui_parent
|
Sets the context to which the callbacks are scoped, and with which app verification will be completed.
|
Public attributes
phone_number
std::string firebase::auth::PhoneAuthOptions::phone_number
The phone number for sign-in, sign-up, or second factor enrollment.
timeout_milliseconds
uint32_t firebase::auth::PhoneAuthOptions::timeout_milliseconds
The maximum amount of time you’re willing to wait for SMS auto-retrieval to be completed by the SDK.
This value is supported on Android devices only.
The minimum timeout is 30 seconds, and the maximum timeout is 2 minutes. If you specified a positive value less than 30 seconds, the SDK will default to 30 seconds. Specifying a timeout that is greater than 120 seconds will result in an IllegalArgumentException being thrown.
Use 0 to disable SMS-auto-retrieval. This will also cause PhoneAuthProvider::Listener::OnCodeAutoRetrievalTimeOut to be called immediately.
ui_parent
UIParent firebase::auth::PhoneAuthOptions::ui_parent
Sets the context to which the callbacks are scoped, and with which app verification will be completed.
On Android, the context should be a jobject referencing an Android Activity. On Apple platforms, this should be a pointer to UIView. For any other platforms, the context is ignored.
If ui_parent isn’t defined (ie: nullptr or nil) then the FirebaseApp’s default Activity or UIView will be used.
Public functions
PhoneAuthOptions
firebase::auth::PhoneAuthOptions::PhoneAuthOptions()
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-01-23 UTC.
[null,null,["Last updated 2024-01-23 UTC."],[],[],null,["# firebase::auth::PhoneAuthOptions Struct Reference\n\nfirebase::auth::PhoneAuthOptions\n================================\n\n\n`#include \u003ccredential.h\u003e`\n\nOptions object for configuring phone validation flows in [PhoneAuthProvider](/docs/reference/cpp/class/firebase/auth/phone-auth-provider#classfirebase_1_1auth_1_1_phone_auth_provider).\n\nSummary\n-------\n\n| ### Constructors and Destructors ||\n|---|---|\n| [PhoneAuthOptions](#structfirebase_1_1auth_1_1_phone_auth_options_1af277d014a85917b83323ba594bbed504)`()` ||\n\n| ### Public attributes ||\n|------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [force_resending_token](#structfirebase_1_1auth_1_1_phone_auth_options_1aec4aaf0d4994672709037da53a7b680b) | [PhoneAuthProvider::ForceResendingToken](/docs/reference/cpp/class/firebase/auth/phone-auth-provider/force-resending-token#classfirebase_1_1auth_1_1_phone_auth_provider_1_1_force_resending_token)` *` Sets the [PhoneAuthProvider::ForceResendingToken](/docs/reference/cpp/class/firebase/auth/phone-auth-provider/force-resending-token#classfirebase_1_1auth_1_1_phone_auth_provider_1_1_force_resending_token) to force another verification SMS to be sent before the auto-retrieval timeout. |\n| [phone_number](#structfirebase_1_1auth_1_1_phone_auth_options_1acad93564b1b7392e0e8f543deb978311) | `std::string` The phone number for sign-in, sign-up, or second factor enrollment. |\n| [timeout_milliseconds](#structfirebase_1_1auth_1_1_phone_auth_options_1a2e58febe0988c8ec04d86a7d1308148e) | `uint32_t` The maximum amount of time you're willing to wait for SMS auto-retrieval to be completed by the SDK. |\n| [ui_parent](#structfirebase_1_1auth_1_1_phone_auth_options_1a6917ed9bb2cddbcd78dfce1d83c36e73) | [UIParent](/docs/reference/cpp/namespace/firebase/auth#namespacefirebase_1_1auth_1a9b38b42e47035c229760f293282a5664) Sets the context to which the callbacks are scoped, and with which app verification will be completed. |\n\nPublic attributes\n-----------------\n\n### force_resending_token\n\n```c++\nPhoneAuthProvider::ForceResendingToken * firebase::auth::PhoneAuthOptions::force_resending_token\n``` \nSets the [PhoneAuthProvider::ForceResendingToken](/docs/reference/cpp/class/firebase/auth/phone-auth-provider/force-resending-token#classfirebase_1_1auth_1_1_phone_auth_provider_1_1_force_resending_token) to force another verification SMS to be sent before the auto-retrieval timeout.\n\nIf nullptr, assume this is a new phone number to verify. If not-NULL, bypass the verification session deduping and force resending a new SMS. This token is received in [PhoneAuthProvider::Listener::OnCodeSent](/docs/reference/cpp/class/firebase/auth/phone-auth-provider/listener#classfirebase_1_1auth_1_1_phone_auth_provider_1_1_listener_1a65f3a2abf007af3dfb1f8d2136bf4c29). This should only be used when the user presses a Resend SMS button. \n\n### phone_number\n\n```c++\nstd::string firebase::auth::PhoneAuthOptions::phone_number\n``` \nThe phone number for sign-in, sign-up, or second factor enrollment. \n\n### timeout_milliseconds\n\n```c++\nuint32_t firebase::auth::PhoneAuthOptions::timeout_milliseconds\n``` \nThe maximum amount of time you're willing to wait for SMS auto-retrieval to be completed by the SDK.\n\nThis value is supported on Android devices only.\n\nThe minimum timeout is 30 seconds, and the maximum timeout is 2 minutes. If you specified a positive value less than 30 seconds, the SDK will default to 30 seconds. Specifying a timeout that is greater than 120 seconds will result in an IllegalArgumentException being thrown.\n\nUse 0 to disable SMS-auto-retrieval. This will also cause [PhoneAuthProvider::Listener::OnCodeAutoRetrievalTimeOut](/docs/reference/cpp/class/firebase/auth/phone-auth-provider/listener#classfirebase_1_1auth_1_1_phone_auth_provider_1_1_listener_1a3ea7ebac04e74de3ff76996ce4090193) to be called immediately. \n\n### ui_parent\n\n```c++\nUIParent firebase::auth::PhoneAuthOptions::ui_parent\n``` \nSets the context to which the callbacks are scoped, and with which app verification will be completed.\n\nOn Android, the context should be a jobject referencing an Android Activity. On Apple platforms, this should be a pointer to UIView. For any other platforms, the context is ignored.\n\nIf ui_parent isn't defined (ie: nullptr or nil) then the FirebaseApp's default Activity or UIView will be used.\n\nPublic functions\n----------------\n\n### PhoneAuthOptions\n\n```c++\n firebase::auth::PhoneAuthOptions::PhoneAuthOptions()\n```"]]