Called once auto_verify_time_out_ms has passed. If using auto SMS retrieval, you can choose to block the UI (do not allow manual input of the verification code) until timeout is hit.
SMS message with verification code sent to phone number.
Called immediately after Auth server sends a verification SMS. Once receiving this, you can allow users to manually input the verification code (even if you're also performing auto-verification). For user manual input case, get the SMS verification code from the user and then call GetCredential with the user's code.
Details
Parameters
verification_id
Pass to GetCredential along with the user-input verification code to complete the phone number verification flow.
force_resending_token
If the user requests that another SMS message be sent, use this when you recall VerifyPhoneNumber.
[null,null,["Last updated 2024-05-07 UTC."],[],[],null,["firebase::auth::PhoneAuthProvider::Listener\n\n\n**This is an abstract class.**\n\n\n`#include \u003ccredential.h\u003e`\n\nReceive callbacks from [VerifyPhoneNumber](/docs/reference/cpp/class/firebase/auth/phone-auth-provider#classfirebase_1_1auth_1_1_phone_auth_provider_1ad8b24001f507a420a3915d0f29865d84) events.\n\nSummary\n\nPlease see [PhoneAuthProvider](/docs/reference/cpp/class/firebase/auth/phone-auth-provider#classfirebase_1_1auth_1_1_phone_auth_provider) for a sample implementation.\n\nPublic functions \n\nListener \n\n```c++\n Listener()\n``` \n\nOnCodeAutoRetrievalTimeOut \n\n```c++\nvirtual void OnCodeAutoRetrievalTimeOut(\n const std::string & verification_id\n)\n``` \nThe timeout specified in [VerifyPhoneNumber](/docs/reference/cpp/class/firebase/auth/phone-auth-provider#classfirebase_1_1auth_1_1_phone_auth_provider_1ad8b24001f507a420a3915d0f29865d84) has expired.\n\nCalled once `auto_verify_time_out_ms` has passed. If using auto SMS retrieval, you can choose to block the UI (do not allow manual input of the verification code) until timeout is hit.\n\n\n| **Note:** This callback is called immediately on iOS, since iOS does not have auto-validation.\n\n\u003cbr /\u003e\n\nOnCodeSent \n\n```c++\nvirtual void OnCodeSent(\n const std::string & verification_id,\n const ForceResendingToken & force_resending_token\n)\n``` \nSMS message with verification code sent to phone number.\n\nCalled immediately after [Auth](/docs/reference/cpp/class/firebase/auth/auth#classfirebase_1_1auth_1_1_auth) server sends a verification SMS. Once receiving this, you can allow users to manually input the verification code (even if you're also performing auto-verification). For user manual input case, get the SMS verification code from the user and then call [GetCredential](/docs/reference/cpp/class/firebase/auth/phone-auth-provider#classfirebase_1_1auth_1_1_phone_auth_provider_1a149b7a3daa4161cd754cdeeff2779437) with the user's code.\n\n\u003cbr /\u003e\n\nOnVerificationCompleted \n\n```c++\nvirtual void OnVerificationCompleted(\n PhoneAuthCredential credential\n)=0\n``` \nPhone number auto-verification succeeded.\n\nCalled when,\n\n- auto-sms-retrieval has succeededflow (2) in [PhoneAuthProvider](/docs/reference/cpp/class/firebase/auth/phone-auth-provider#classfirebase_1_1auth_1_1_phone_auth_provider)\n- instant validation has succeededflow (3) in [PhoneAuthProvider](/docs/reference/cpp/class/firebase/auth/phone-auth-provider#classfirebase_1_1auth_1_1_phone_auth_provider)\n\n\u003cbr /\u003e\n\n\n| **Note:** This callback is never called on iOS, since iOS does not have auto-validation. It is always called immediately in the stub desktop implementation, however, since it fakes immediate success.\n\n\u003cbr /\u003e\n\nOnVerificationFailed \n\n```c++\nvirtual void OnVerificationFailed(\n const std::string & error\n)=0\n``` \nPhone number verification failed with an error.\n\nCalled when and error occurred doing phone number authentication. For example,\n\n- quota exceeded\n- unknown phone number format\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\\~Listener \n\n```c++\nvirtual ~Listener()\n```"]]