PushNotificationDelegate
public protocol PushNotificationDelegate : AnyObject, Sendable
Protocol to be implemented by push notification clients. All methods are optional.
-
receivedForegroundNotification(_:Asynchronous) Called when a notification is received in the foreground.
Declaration
Swift
@MainActor func receivedForegroundNotification(_ userInfo: [AnyHashable : Any]) asyncParameters
userInfoThe notification info
-
receivedBackgroundNotification(_:Asynchronous) Called when a notification is received in the background.
Declaration
Swift
@MainActor func receivedBackgroundNotification(_ userInfo: [AnyHashable : Any]) async -> UIBackgroundFetchResultParameters
userInfoThe notification info
-
Called when a notification is received in the background.
-
receivedNotificationResponse(_:Asynchronous) Called when a notification is received in the background or foreground and results in a user interaction. User interactions can include launching the application from the push, or using an interactive control on the notification interface such as a button or text field.
Declaration
Swift
@MainActor func receivedNotificationResponse(_ notificationResponse: UNNotificationResponse) asyncParameters
notificationResponseUNNotificationResponse object representing the user’s response to the notification and the associated notification contents.
-
extendPresentationOptions(_:Asynchronousnotification: ) Called when a notification has arrived in the foreground and is available for display.
Declaration
Swift
@MainActor func extendPresentationOptions( _ options: UNNotificationPresentationOptions, notification: UNNotification ) async -> UNNotificationPresentationOptionsParameters
optionsThe notification presentation options.
notificationThe notification.
View on GitHub