FirebasePhoneNumberVerification

Firebase Phone Number Verification: gets the phone number of a SIM in the device directly from its carrier, with a token signed by Firebase for your backend to verify, instead of sending an SMS code.

It exists on Android only. On iOS, macOS, tvOS, JS and Wasm every operation throws UnsupportedOperationException and enableTestSession does nothing; keep an SMS sign-in for them. See com.google.firebase.pnv.FirebasePhoneNumberVerification for each member's behaviour.

Properties

Link copied to clipboard

The underlying Firebase Android SDK object.

Link copied to clipboard

Functions

Link copied to clipboard
fun enableTestSession(testNumberId: String)

Enables a test session with testNumberId, a test token generated in the Firebase console, so verification works without a SIM. Call it at most once: on Android a second call throws a FirebasePhoneNumberVerificationException.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard

Exchanges dcApiResponse, the Firebase token of the Credential Manager's response to the request built with getDigitalCredentialPayload, for the verified phone number and its Firebase PNV token.

Link copied to clipboard

Starts a verification through your own Android Credential Manager request: returns the server-signed payload of the request's Digital Credentials query, for the single-use nonce your server generated. Pass the Credential Manager's response to exchangeCredentialResponseForPhoneNumber.

Link copied to clipboard

Whether each SIM of the device supports verification, one result per SIM (in a test session, one for the test number). Asks the user for nothing; check it before offering verification, and fall back to SMS otherwise.

Whether the SIM in simSlot (0 or 1) supports verification, as the one result of a list.

Link copied to clipboard

Verifies the phone number of a SIM in the device: asks the user for consent through the Android Credential Manager, gets the number from the carrier, and returns it with its Firebase PNV token, which your backend verifies. context is an android.content.Context that is, or wraps, an android.app.Activity. Throws a FirebasePhoneNumberVerificationException if the verification fails.

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String