FIRPhoneAuthProvider


@interface FIRPhoneAuthProvider : NSObject

A concrete implementation of FIRAuthProvider for phone auth providers.

  • Returns an instance of FIRPhoneAuthProvider for the default FIRAuth object.

    Declaration

    Objective-C

    + (nonnull instancetype)provider;
  • Returns an instance of FIRPhoneAuthProvider for the provided FIRAuth object.

    Declaration

    Objective-C

    + (nonnull instancetype)providerWithAuth:(nonnull FIRAuth *)auth;

    Parameters

    auth

    The auth object to associate with the phone auth provider instance.

  • Starts the phone number authentication flow by sending a verifcation code to the specified phone number.

    Declaration

    Objective-C

    - (void)verifyPhoneNumber:(nonnull NSString *)phoneNumber
                   UIDelegate:(nullable id<FIRAuthUIDelegate>)UIDelegate
                   completion:(nullable FIRVerificationResultCallback)completion;

    Parameters

    phoneNumber

    The phone number to be verified.

    UIDelegate

    An object used to present the SFSafariViewController. The object is retained by this method until the completion block is executed.

    completion

    The callback to be invoked when the verification flow is finished. Possible error codes:

    • FIRAuthErrorCodeCaptchaCheckFailed - Indicates that the reCAPTCHA token obtained by the Firebase Auth is invalid or has expired.
    • FIRAuthErrorCodeQuotaExceeded - Indicates that the phone verification quota for this project has been exceeded.
    • FIRAuthErrorCodeInvalidPhoneNumber - Indicates that the phone number provided is invalid.
    • FIRAuthErrorCodeMissingPhoneNumber - Indicates that a phone number was not provided.
  • Creates an FIRAuthCredential for the phone number provider identified by the verification ID and verification code.

    Declaration

    Objective-C

    - (nonnull FIRPhoneAuthCredential *)
    credentialWithVerificationID:(nonnull NSString *)verificationID
                verificationCode:(nonnull NSString *)verificationCode;

    Parameters

    verificationID

    The verification ID obtained from invoking verifyPhoneNumber:completion:

    verificationCode

    The verification code obtained from the user.

    Return Value

    The corresponding phone auth credential for the verification ID and verification code provided.

  • Please use the provider or providerWithAuth: methods to obtain an instance of FIRPhoneAuthProvider.

    Declaration

    Objective-C

    - (nonnull instancetype)init;