RegistrationDelegate
public protocol RegistrationDelegate : AnyObject
Implement this protocol and add as a Push.registrationDelegate to receive registration success and failure callbacks.
-
notificationRegistrationFinished(withAuthorizedSettings:Default implementationcategories: status: ) Called when APNS registration completes.
Default Implementation
Declaration
Swift
@MainActor func notificationRegistrationFinished( withAuthorizedSettings authorizedSettings: AirshipAuthorizedNotificationSettings, categories: Set<UNNotificationCategory>, status: UNAuthorizationStatus )Parameters
authorizedSettingsThe settings that were authorized at the time of registration.
categoriesSet of the categories that were most recently registered.
statusThe authorization status.
-
notificationRegistrationFinished(withAuthorizedSettings:Default implementationstatus: ) Called when APNS registration completes.
Default Implementation
Declaration
Swift
@MainActor func notificationRegistrationFinished( withAuthorizedSettings authorizedSettings: AirshipAuthorizedNotificationSettings, status: UNAuthorizationStatus )Parameters
authorizedSettingsThe settings that were authorized at the time of registration.
statusThe authorization status.
-
notificationAuthorizedSettingsDidChange(_:Default implementation) Called when notification authentication changes with the new authorized settings.
Default Implementation
Declaration
Swift
@MainActor func notificationAuthorizedSettingsDidChange( _ authorizedSettings: AirshipAuthorizedNotificationSettings )Parameters
authorizedSettingsAirshipAuthorizedNotificationSettings The newly changed authorized settings.
-
apnsRegistrationSucceeded(withDeviceToken:Default implementation) Called when the UIApplicationDelegate’s application:didRegisterForRemoteNotificationsWithDeviceToken: delegate method is called.
Default Implementation
Declaration
Swift
@MainActor func apnsRegistrationSucceeded( withDeviceToken deviceToken: Data )Parameters
deviceTokenThe APNS device token.
-
apnsRegistrationFailedWithError(_:Default implementation) Called when the UIApplicationDelegate’s application:didFailToRegisterForRemoteNotificationsWithError: delegate method is called.
Default Implementation
Declaration
Swift
@MainActor func apnsRegistrationFailedWithError(_ error: any Error)Parameters
errorAn NSError object that encapsulates information why registration did not succeed.
View on GitHub