PhoneAuthCredential

public classPhoneAuthCredential extendsAuthCredential implementsCloneable


Wraps phone number and verification information for authentication purposes.

Summary

Public fields

@NullableString

Public methods

@NonNullString

Returns the unique string identifier for the provider type with which the credential is associated.

@NonNullString

Returns the unique string identifier for the sign in method with which the credential is associated.

@NullableString

Gets the auto-retrieved SMS verification code if applicable.

Inherited Constants

Fromandroid.os.Parcelable
static final int
static final int

Inherited methods

Fromandroid.os.Parcelable
abstract int

Constants

CREATOR

public static final Parcelable.Creator<PhoneAuthCredentialCREATOR

Public fields

smsCode

public @NullableString smsCode

Public methods

getProvider

public @NonNullString getProvider()

Returns the unique string identifier for the provider type with which the credential is associated.

getSignInMethod

public @NonNullString getSignInMethod()

Returns the unique string identifier for the sign in method with which the credential is associated. Should match that returned byfetchSignInMethodsForEmail after this user has signed in with this type of credential.

getSmsCode

public @NullableString getSmsCode()

Gets the auto-retrieved SMS verification code if applicable. When SMS verification is used, you will be called back first viaonCodeSent, and lateronVerificationCompleted with a containing a non-null SMS code if auto-retrieval succeeded. If Firebase used another approach to verify the phone number and triggers a callback viaonVerificationCompleted, then SMS code can benull.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-07-21 UTC.