firebase::auth::PhoneAuthProvider::Listener

This is an abstract class.

#include <credential.h>

Receive callbacks from VerifyPhoneNumber events.

Summary

Please see PhoneAuthProvider for a sample implementation.

Constructors and Destructors

Listener()
~Listener()

Public functions

OnCodeAutoRetrievalTimeOut(const std::string & verification_id)
virtual void
The timeout specified in VerifyPhoneNumber has expired.
OnCodeSent(const std::string & verification_id, const ForceResendingToken & force_resending_token)
virtual void
SMS message with verification code sent to phone number.
OnVerificationCompleted(Credential credential)
virtual void
Deprecated. This method has been deprecated. Please use OnVerificationCompleted(PhoneAuthCredential) instead.
Phone number auto-verification succeeded.
OnVerificationCompleted(PhoneAuthCredential credential)=0
virtual void
Phone number auto-verification succeeded.
OnVerificationFailed(const std::string & error)=0
virtual void
Phone number verification failed with an error.

Public functions

Listener

 Listener()

OnCodeAutoRetrievalTimeOut

virtual void OnCodeAutoRetrievalTimeOut(
  const std::string & verification_id
)

The timeout specified in VerifyPhoneNumber has expired.

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.

Details
Parameters
verification_id
Identify the transaction that has timed out.

OnCodeSent

virtual void OnCodeSent(
  const std::string & verification_id,
  const ForceResendingToken & force_resending_token
)

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.

OnVerificationCompleted

virtual void OnVerificationCompleted(
  Credential credential
)

Phone number auto-verification succeeded.

Deprecated. This method has been deprecated. Please use OnVerificationCompleted(PhoneAuthCredential) instead.

Called when,

Details
Parameters
credential
The completed credential from the phone number verification flow.

OnVerificationCompleted

virtual void OnVerificationCompleted(
  PhoneAuthCredential credential
)=0

Phone number auto-verification succeeded.

Called when,

Details
Parameters
credential
The completed credential from the phone number verification flow.

OnVerificationFailed

virtual void OnVerificationFailed(
  const std::string & error
)=0

Phone number verification failed with an error.

Called when and error occurred doing phone number authentication. For example,

  • quota exceeded
  • unknown phone number format

Details
Parameters
error
A description of the failure.

~Listener

virtual  ~Listener()