PhoneAuthProvider.OnVerificationStateChangedCallbacks

public abstract class PhoneAuthProvider.OnVerificationStateChangedCallbacks


Registered callbacks for the different phone auth events. Requires implementing two mandatory callbacks and provides default no-op implementations for optional callbacks.

Summary

Public constructors

Public methods

void

Optional callback.

void
onCodeSent(
    @NonNull String verificationId,
    @NonNull PhoneAuthProvider.ForceResendingToken forceResendingToken
)

Optional callback.

abstract void

This callback must be implemented.

abstract void

This callback must be implemented.

Public constructors

OnVerificationStateChangedCallbacks

public OnVerificationStateChangedCallbacks()

Public methods

onCodeAutoRetrievalTimeOut

public void onCodeAutoRetrievalTimeOut(@NonNull String verificationId)

Optional callback. It will trigger when SMS auto-retrieval times out and provide a verificationId.

onCodeSent

public void onCodeSent(
    @NonNull String verificationId,
    @NonNull PhoneAuthProvider.ForceResendingToken forceResendingToken
)

Optional callback. It will trigger when an SMS has been sent to the users phone, and will include a verificationId and ForceResendingToken.

onVerificationCompleted

public abstract void onVerificationCompleted(@NonNull PhoneAuthCredential credential)

This callback must be implemented. It will trigger when an SMS is auto-retrieved or the phone number has been instantly verified. The callback will provide a AuthCredential.

onVerificationFailed

public abstract void onVerificationFailed(@NonNull FirebaseException exception)

This callback must be implemented.

Triggered when an error occurred during phone number verification.

Exceptions