VerifiedPhoneNumberTokenResult

A verified phone number with its Firebase PNV token, mirroring com.google.firebase.pnv.VerifiedPhoneNumberTokenResult; from FirebasePhoneNumberVerification.getVerifiedPhoneNumber and FirebasePhoneNumberVerification.exchangeCredentialResponseForPhoneNumber. Send getToken to your backend, which verifies its signature: this class only reads the claims of the token, without verifying it.

Constructing one parses token, a JWT. It throws a FirebasePhoneNumberVerificationException with FirebasePnvStatusCodes.INVALID_DIGITAL_CREDENTIAL_RESPONSE when the token is empty, does not have three parts, or its payload is not a base64url-encoded JSON object. On Android this is the SDK class (also Parcelable); the other platforms parse the token the same way.

A verified phone number with its Firebase PNV token, mirroring com.google.firebase.pnv.VerifiedPhoneNumberTokenResult; from FirebasePhoneNumberVerification.getVerifiedPhoneNumber and FirebasePhoneNumberVerification.exchangeCredentialResponseForPhoneNumber. Send getToken to your backend, which verifies its signature: this class only reads the claims of the token, without verifying it.

Constructing one parses token, a JWT. It throws a FirebasePhoneNumberVerificationException with FirebasePnvStatusCodes.INVALID_DIGITAL_CREDENTIAL_RESPONSE when the token is empty, does not have three parts, or its payload is not a base64url-encoded JSON object. On Android this is the SDK class (also Parcelable); the other platforms parse the token the same way.

A verified phone number with its Firebase PNV token, mirroring com.google.firebase.pnv.VerifiedPhoneNumberTokenResult; from FirebasePhoneNumberVerification.getVerifiedPhoneNumber and FirebasePhoneNumberVerification.exchangeCredentialResponseForPhoneNumber. Send getToken to your backend, which verifies its signature: this class only reads the claims of the token, without verifying it.

Constructing one parses token, a JWT. It throws a FirebasePhoneNumberVerificationException with FirebasePnvStatusCodes.INVALID_DIGITAL_CREDENTIAL_RESPONSE when the token is empty, does not have three parts, or its payload is not a base64url-encoded JSON object. On Android this is the SDK class (also Parcelable); the other platforms parse the token the same way.

Constructors

Link copied to clipboard
actual constructor(token: String)
expect constructor(token: String)
actual constructor(token: String)

Types

Link copied to clipboard
actual object Companion

The Android SDK class's companion object, which holds its Parcelable CREATOR there; no members here.

expect object Companion

The Android SDK class's companion object, which holds its Parcelable CREATOR there; no members here.

actual object Companion

The Android SDK class's companion object, which holds its Parcelable CREATOR there; no members here.

Functions

Link copied to clipboard
actual fun getClaims(): Map<String, Any>

Every claim of the token, sorted by name. A JSON string is a String, true and false are a Boolean, a number is an Int, a Long (when it does not fit in an Int) or a Double (when it has a fraction or an exponent). Nested objects and arrays are org.json.JSONObject and JSONArray on Android, Map and List elsewhere; a claim whose value is null is org.json.JSONObject.NULL on Android and left out elsewhere.

expect fun getClaims(): Map<String, Any>

Every claim of the token, sorted by name. A JSON string is a String, true and false are a Boolean, a number is an Int, a Long (when it does not fit in an Int) or a Double (when it has a fraction or an exponent). Nested objects and arrays are org.json.JSONObject and JSONArray on Android, Map and List elsewhere; a claim whose value is null is org.json.JSONObject.NULL on Android and left out elsewhere.

actual fun getClaims(): Map<String, Any>

Every claim of the token, sorted by name. A JSON string is a String, true and false are a Boolean, a number is an Int, a Long (when it does not fit in an Int) or a Double (when it has a fraction or an exponent). Nested objects and arrays are org.json.JSONObject and JSONArray on Android, Map and List elsewhere; a claim whose value is null is org.json.JSONObject.NULL on Android and left out elsewhere.

Link copied to clipboard

When the token expires, its exp claim in seconds since the epoch; 0 without one.

When the token expires, its exp claim in seconds since the epoch; 0 without one.

When the token expires, its exp claim in seconds since the epoch; 0 without one.

Link copied to clipboard

When the token was issued, its iat claim in seconds since the epoch; 0 without one.

When the token was issued, its iat claim in seconds since the epoch; 0 without one.

When the token was issued, its iat claim in seconds since the epoch; 0 without one.

Link copied to clipboard
actual fun getNonce(): String

The nonce of the request, the token's nonce claim.

expect fun getNonce(): String

The nonce of the request, the token's nonce claim.

actual fun getNonce(): String

The nonce of the request, the token's nonce claim.

Link copied to clipboard
actual fun getPhoneNumber(): String

The verified phone number, the token's sub claim.

expect fun getPhoneNumber(): String

The verified phone number, the token's sub claim.

actual fun getPhoneNumber(): String

The verified phone number, the token's sub claim.

Link copied to clipboard
actual fun getToken(): String

The Firebase PNV token: a JWT signed by Firebase, whose sub claim is the verified phone number.

expect fun getToken(): String

The Firebase PNV token: a JWT signed by Firebase, whose sub claim is the verified phone number.

actual fun getToken(): String

The Firebase PNV token: a JWT signed by Firebase, whose sub claim is the verified phone number.