Type-Definitions

The following type definitions are available globally.

  • @related FIRMessaging

    The completion handler invoked when the registration token returns. If the call fails we return the appropriate error code, described by FIRMessagingError.

    Declaration

    Swift

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

    Objective-C

    typedef void (^FIRMessagingFCMTokenFetchCompletion)(NSString *_Nullable,
                                                        NSError *_Nullable)

    Parameters

    FCMToken

    The valid registration token returned by FCM.

    error

    The error describing why a token request failed. The error code will match a value from the FIRMessagingError enumeration.

  • @related FIRMessaging

    The completion handler invoked when the registration token deletion request is completed. If the call fails we return the appropriate error code, described by FIRMessagingError.

    Declaration

    Swift

    typealias MessagingDeleteFCMTokenCompletion = (Error?) -> Void

    Objective-C

    typedef void (^FIRMessagingDeleteFCMTokenCompletion)(NSError *_Nullable)

    Parameters

    error

    The error describing why a token deletion failed. The error code will match a value from the FIRMessagingError enumeration.

  • The completion handler invoked once the data connection with FIRMessaging is established. The data connection is used to send a continuous stream of data and all the FIRMessaging data notifications arrive through this connection. Once the connection is established we invoke the callback with nil error. Correspondingly if we get an error while trying to establish a connection we invoke the handler with an appropriate error object and do an exponential backoff to try and connect again unless successful.

    Declaration

    Swift

    typealias MessagingConnectCompletion = (Error?) -> Void

    Objective-C

    typedef void (^FIRMessagingConnectCompletion)(NSError *_Nullable)

    Parameters

    error

    The error object if any describing why the data connection to FIRMessaging failed.