Type-Definitions

The following type definitions are available globally.

  • The type of block invoked when a request to update the current user is completed.

    Declaration

    Swift

    typealias UserUpdateCallback = (Error?) -> Void
  • The type of handle returned by FIRAuth.addAuthStateDidChangeListener:.

    Declaration

    Swift

    typealias AuthStateDidChangeListenerHandle = NSObjectProtocol
  • The type of block which can be registered as a listener for auth state did change events.

    Declaration

    Swift

    typealias AuthStateDidChangeListenerBlock = (Auth, FIRUser?) -> Void

    Parameters

    auth

    The FIRAuth object on which state changes occurred.

    user

    Optionally; the current signed in user, if any.

  • The type of handle returned by FIRAuth.addIDTokenDidChangeListener:.

    Declaration

    Swift

    typealias IDTokenDidChangeListenerHandle = NSObjectProtocol
  • The type of block which can be registered as a listener for ID token did change events.

    Declaration

    Swift

    typealias IDTokenDidChangeListenerBlock = (Auth, FIRUser?) -> Void

    Parameters

    auth

    The FIRAuth object on which ID token changes occurred.

    user

    Optionally; the current signed in user, if any.

  • The type of block invoked when sign-in related events complete.

    Declaration

    Swift

    typealias AuthDataResultCallback = (FIRAuthDataResult?, Error?) -> Void

    Parameters

    authResult

    Optionally; Result of sign-in request containing both the user and the additional user info associated with the user.

    error

    Optionally; the error which occurred - or nil if the request was successful.

  • The type of block invoked when sign-in related events complete.

    Declaration

    Swift

    typealias AuthResultCallback = (FIRUser?, Error?) -> Void

    Parameters

    user

    Optionally; the signed in user, if any.

    error

    Optionally; if an error occurs, this is the NSError object that describes the problem. Set to nil otherwise.

  • The type of block invoked when a list of identity providers for a given email address is requested.

    Declaration

    Swift

    typealias ProviderQueryCallback = ([String]?, Error?) -> Void

    Parameters

    providers

    Optionally; a list of provider identifiers, if any.

    See

    FIRGoogleAuthProviderID etc.

    error

    Optionally; if an error occurs, this is the NSError object that describes the problem. Set to nil otherwise.

  • The type of block invoked when a list of sign-in methods for a given email address is requested.

    Declaration

    Swift

    typealias SignInMethodQueryCallback = ([String]?, Error?) -> Void
  • The type of block invoked when sending a password reset email.

    Declaration

    Swift

    typealias SendPasswordResetCallback = (Error?) -> Void

    Parameters

    error

    Optionally; if an error occurs, this is the NSError object that describes the problem. Set to nil otherwise.

  • The type of block invoked when sending an email sign-in link email.

    Declaration

    Swift

    typealias SendSignInLinkToEmailCallback = (Error?) -> Void
  • The type of block invoked when performing a password reset.

    Declaration

    Swift

    typealias ConfirmPasswordResetCallback = (Error?) -> Void

    Parameters

    error

    Optionally; if an error occurs, this is the NSError object that describes the problem. Set to nil otherwise.

  • The type of block invoked when verifying that an out of band code should be used to perform password reset.

    Declaration

    Swift

    typealias VerifyPasswordResetCodeCallback = (String?, Error?) -> Void

    Parameters

    email

    Optionally; the email address of the user for which the out of band code applies.

    error

    Optionally; if an error occurs, this is the NSError object that describes the problem. Set to nil otherwise.

  • The type of block invoked when applying an action code.

    Declaration

    Swift

    typealias ApplyActionCodeCallback = (Error?) -> Void

    Parameters

    error

    Optionally; if an error occurs, this is the NSError object that describes the problem. Set to nil otherwise.

  • The type of block invoked when performing a check action code operation.

    Declaration

    Swift

    typealias CheckActionCodeCallback = (ActionCodeInfo?, Error?) -> Void

    Parameters

    info

    Metadata corresponding to the action code.

    error

    Optionally; if an error occurs, this is the NSError object that describes the problem. Set to nil otherwise.

  • The type of block invoked when a request to send a verification code has finished.

    Declaration

    Swift

    typealias VerificationResultCallback = (String?, Error?) -> Void

    Parameters

    verificationID

    On success, the verification ID provided, nil otherwise.

    error

    On error, the error that occured, nil otherwise.

  • The type of block called when a token is ready for use.

    See

    FIRUser.getIDTokenWithCompletion:

    See

    FIRUser.getIDTokenForcingRefresh:withCompletion:

    One of: token or error will always be non-nil.

    Declaration

    Swift

    typealias AuthTokenCallback = (String?, Error?) -> Void

    Parameters

    token

    Optionally; an access token if the request was successful.

    error

    Optionally; the error which occurred - or nil if the request was successful.

  • The type of block called when a token is ready for use.

    See

    FIRUser.getIDTokenResultWithCompletion:

    See

    FIRUser.getIDTokenResultForcingRefresh:withCompletion:

    One of: token or error will always be non-nil.

    Declaration

    Swift

    typealias AuthTokenResultCallback = (FIRAuthTokenResult?, Error?) -> Void

    Parameters

    tokenResult

    Optionally; an object containing the raw access token string as well as other useful data pertaining to the token.

    error

    Optionally; the error which occurred - or nil if the request was successful.

  • The type of block called when a user profile change has finished.

    Declaration

    Swift

    typealias UserProfileChangeCallback = (Error?) -> Void

    Parameters

    error

    Optionally; the error which occurred - or nil if the request was successful.

  • The type of block called when a request to send an email verification has finished.

    Declaration

    Swift

    typealias SendEmailVerificationCallback = (Error?) -> Void

    Parameters

    error

    Optionally; the error which occurred - or nil if the request was successful.