RegistrationDelegate

public protocol RegistrationDelegate : AnyObject

Implement this protocol and add as a Push.registrationDelegate to receive registration success and failure callbacks.

  • Called when APNS registration completes.

    Default Implementation

    Declaration

    Swift

    func notificationRegistrationFinished(
        withAuthorizedSettings authorizedSettings:
            AirshipAuthorizedNotificationSettings,
        categories: Set<UNNotificationCategory>,
        status: UNAuthorizationStatus
    )

    Parameters

    authorizedSettings

    The settings that were authorized at the time of registration.

    categories

    Set of the categories that were most recently registered.

    status

    The authorization status.

  • Called when APNS registration completes.

    Default Implementation

    Declaration

    Swift

    func notificationRegistrationFinished(
        withAuthorizedSettings authorizedSettings:
            AirshipAuthorizedNotificationSettings,
        status: UNAuthorizationStatus
    )

    Parameters

    authorizedSettings

    The settings that were authorized at the time of registration.

    status

    The authorization status.

  • Called when notification authentication changes with the new authorized settings.

    Default Implementation

    Declaration

    Swift

    func notificationAuthorizedSettingsDidChange(
        _ authorizedSettings: AirshipAuthorizedNotificationSettings
    )

    Parameters

    authorizedSettings

    AirshipAuthorizedNotificationSettings The newly changed authorized settings.

  • Called when the UIApplicationDelegate’s application:didRegisterForRemoteNotificationsWithDeviceToken: delegate method is called.

    Default Implementation

    Declaration

    Swift

    func apnsRegistrationSucceeded(
        withDeviceToken deviceToken: Data
    )

    Parameters

    deviceToken

    The APNS device token.

  • apnsRegistrationFailedWithError(_:) Default implementation

    Called when the UIApplicationDelegate’s application:didFailToRegisterForRemoteNotificationsWithError: delegate method is called.

    Default Implementation

    Declaration

    Swift

    func apnsRegistrationFailedWithError(_ error: any Error)

    Parameters

    error

    An NSError object that encapsulates information why registration did not succeed.