FirebasePhoneNumberVerification

interface FirebasePhoneNumberVerification


Entry point for Firebase Phone Number Verification.

Summary

Public companion functions

FirebasePhoneNumberVerification

Returns an instance of FirebasePhoneNumberVerification using the default FirebaseApp and its application context.

FirebasePhoneNumberVerification
getInstance(context: Context)

Returns an instance of FirebasePhoneNumberVerification for the given Context and the default FirebaseApp.

FirebasePhoneNumberVerification
getInstance(firebaseApp: FirebaseApp)

Returns an instance of FirebasePhoneNumberVerification for the given FirebaseApp.

FirebasePhoneNumberVerification
getInstance(firebaseApp: FirebaseApp, context: Context)

Returns an instance of FirebasePhoneNumberVerification for the given FirebaseApp and a Context.

Public functions

Task<VerifiedPhoneNumberTokenResult>

Completes the phone number verification process by exchanging a response from Credential Manager for a verified phone number token.

Task<String>

Prepares for a phone number verification flow by performing preflight checks and returning a digital credential payload for use with Android's Credential Manager.

Task<List<VerificationSupportResult>>

Checks if phone number verification is supported for all SIMs.

Task<List<VerificationSupportResult>>

Checks if phone number verification is supported for a specific simSlot.

Task<VerifiedPhoneNumberTokenResult>

Initiates the phone number verification process by getting a signed request, interacting with Credential Manager, and exchanging the response for a verified phone number token.

Public companion functions

getInstance

fun getInstance(): FirebasePhoneNumberVerification

Returns an instance of FirebasePhoneNumberVerification using the default FirebaseApp and its application context.

Note that for methods that require an Activity context, using the result of this method will result in an IllegalArgumentException.

getInstance

fun getInstance(context: Context): FirebasePhoneNumberVerification

Returns an instance of FirebasePhoneNumberVerification for the given Context and the default FirebaseApp. Note that for methods that require an Activity context, providing a non-Activity context will result in an IllegalArgumentException.

getInstance

fun getInstance(firebaseApp: FirebaseApp): FirebasePhoneNumberVerification

Returns an instance of FirebasePhoneNumberVerification for the given FirebaseApp. It will be initialized with the application context.

Note that for methods that require an Activity context, using the result of this method will result in an IllegalArgumentException.

getInstance

fun getInstance(firebaseApp: FirebaseApp, context: Context): FirebasePhoneNumberVerification

Returns an instance of FirebasePhoneNumberVerification for the given FirebaseApp and a Context. The instance will be initialized with the provided Context. Note that for methods that require an Activity context, providing a non-Activity context will result in an IllegalArgumentException.

Public functions

exchangeCredentialResponseForPhoneNumber

fun exchangeCredentialResponseForPhoneNumber(dcApiResponse: String): Task<VerifiedPhoneNumberTokenResult>

Completes the phone number verification process by exchanging a response from Credential Manager for a verified phone number token.

getDigitalCredentialPayload

fun getDigitalCredentialPayload(nonce: String): Task<String>

Prepares for a phone number verification flow by performing preflight checks and returning a digital credential payload for use with Android's Credential Manager.

Parameters
nonce: String

A unique string used to prevent replay attacks. screen.

getVerificationSupportInfo

fun getVerificationSupportInfo(): Task<List<VerificationSupportResult>>

Checks if phone number verification is supported for all SIMs.

This is a pre-check to determine if the verification flow is likely to succeed and does not require user consent.

The returned Task completes with a list of VerificationSupportResult objects containing information about verification support for all SIM slots.

getVerificationSupportInfo

fun getVerificationSupportInfo(simSlot: Int): Task<List<VerificationSupportResult>>

Checks if phone number verification is supported for a specific simSlot.

This is a pre-check to determine if the verification flow is likely to succeed and does not require user consent.

The returned Task completes with a VerificationSupportResult object containing information about verification support for the specified simSlot.

Throws IllegalArgumentException if the provided simSlot is not 0 or 1.

getVerifiedPhoneNumber

fun getVerifiedPhoneNumber(): Task<VerifiedPhoneNumberTokenResult>

Initiates the phone number verification process by getting a signed request, interacting with Credential Manager, and exchanging the response for a verified phone number token. This function handles the entire end-to-end flow.