UARegistrationDelegate

@protocol UARegistrationDelegate <NSObject>

Implement this protocol and add as a [UAPush registrationDelegate] to receive registration success and failure callbacks.

  • Called after the device channel registers with Airship. Successful registrations could be disabling push, enabling push, or updating the device registration settings.

    The device token will only be available once the application successfully registers with APNS.

    When registration finishes in the background, any async tasks that are triggered from this call should request a background task.

    Note

    This method may be called at any time. It does not guarantee a channel registration just occurred.

    Declaration

    Objective-C

    - (void)registrationSucceededForChannelID:(nonnull NSString *)channelID
                                  deviceToken:(nonnull NSString *)deviceToken;

    Swift

    optional func registrationSucceeded(forChannelID channelID: String, deviceToken: String)

    Parameters

    channelID

    The channel ID string.

    deviceToken

    The device token string.

  • Called when the device channel failed to register with Airship.

    When registration finishes in the background, any async tasks that are triggered from this call should request a background task.

    Declaration

    Objective-C

    - (void)registrationFailed;

    Swift

    optional func registrationFailed()
  • Called when APNS registration completes.

    Declaration

    Objective-C

    - (void)
        notificationRegistrationFinishedWithAuthorizedSettings:
            (UAAuthorizedNotificationSettings)authorizedSettings
                                                    categories:
                                                        (nonnull NSSet<
                                                            UANotificationCategory
                                                                *> *)categories
                                                        status:
                                                            (UAAuthorizationStatus)
                                                                status;

    Swift

    optional func notificationRegistrationFinished(withAuthorizedSettings authorizedSettings: UAAuthorizedNotificationSettings, categories: Set<AnyHashable>, status: UAAuthorizationStatus)

    Parameters

    authorizedSettings

    The settings that were authorized at the time of registration.

    categories

    NSSet of the categories that were most recently registered.

    status

    The authorization status.

  • Called when APNS registration completes.

    Declaration

    Objective-C

    - (void)
        notificationRegistrationFinishedWithAuthorizedSettings:
            (UAAuthorizedNotificationSettings)authorizedSettings
                                                    categories:
                                                        (nonnull NSSet<
                                                            UANotificationCategory
                                                                *> *)categories;

    Swift

    optional func notificationRegistrationFinished(withAuthorizedSettings authorizedSettings: UAAuthorizedNotificationSettings, categories: Set<AnyHashable>)

    Parameters

    authorizedSettings

    The settings that were authorized at the time of registration.

    categories

    NSSet of the categories that were most recently registered.

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

    Declaration

    Objective-C

    - (void)notificationAuthorizedSettingsDidChange:
        (UAAuthorizedNotificationSettings)authorizedSettings;

    Swift

    optional func notificationAuthorizedSettingsDidChange(_ authorizedSettings: UAAuthorizedNotificationSettings)

    Parameters

    authorizedSettings

    UAAuthorizedNotificationSettings The newly changed authorized settings.

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

    Declaration

    Objective-C

    - (void)apnsRegistrationSucceededWithDeviceToken:(nonnull NSData *)deviceToken;

    Swift

    optional func apnsRegistrationSucceeded(withDeviceToken deviceToken: Data)

    Parameters

    deviceToken

    The APNS device token.

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

    Declaration

    Objective-C

    - (void)apnsRegistrationFailedWithError:(nonnull NSError *)error;

    Swift

    optional func apnsRegistrationFailedWithError(_ error: Error)

    Parameters

    error

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