PhoneAuthProvider.OnVerificationStateChangedCallbacks

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 functions

Unit

Optional callback.

Unit
onCodeSent(
    verificationId: String,
    forceResendingToken: PhoneAuthProvider.ForceResendingToken
)

Optional callback.

abstract Unit

This callback must be implemented.

abstract Unit

This callback must be implemented.

Public constructors

OnVerificationStateChangedCallbacks

OnVerificationStateChangedCallbacks()

Public functions

onCodeAutoRetrievalTimeOut

fun onCodeAutoRetrievalTimeOut(verificationId: String): Unit

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

onCodeSent

fun onCodeSent(
    verificationId: String,
    forceResendingToken: PhoneAuthProvider.ForceResendingToken
): Unit

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

onVerificationCompleted

abstract fun onVerificationCompleted(credential: PhoneAuthCredential): Unit

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

abstract fun onVerificationFailed(exception: FirebaseException): Unit

This callback must be implemented.

Triggered when an error occurred during phone number verification.

Exceptions