PushNotificationDelegate

@objc(UAPushNotificationDelegate)
public protocol PushNotificationDelegate : NSObjectProtocol

Protocol to be implemented by push notification clients. All methods are optional.

  • Called when a notification is received in the foreground.

    Declaration

    Swift

    @objc
    optional func receivedForegroundNotification(
        _ userInfo: [AnyHashable: Any],
        completionHandler: @escaping () -> Void
    )

    Parameters

    userInfo

    The notification info

    completionHandler

    the completion handler to execute when notification processing is complete.

  • Called when a notification is received in the background.

    Declaration

    Swift

    @objc
    optional func receivedBackgroundNotification(
        _ userInfo: [AnyHashable: Any],
        completionHandler: @escaping (UIBackgroundFetchResult) -> Void
    )

    Parameters

    userInfo

    The notification info

    completionHandler

    the completion handler to execute when notification processing is complete.

  • Called when a notification is received in the background.

  • 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

    @objc
    optional func receivedNotificationResponse(
        _ notificationResponse: UNNotificationResponse,
        completionHandler: @escaping () -> Void
    )

    Parameters

    notificationResponse

    UNNotificationResponse object representing the user’s response to the notification and the associated notification contents.

    completionHandler

    the completion handler to execute when processing the user’s response has completed.

  • Called when a notification has arrived in the foreground and is available for display.

    Declaration

    Swift

    @objc(extendPresentationOptions:notification:)
    optional func extend(
        _ options: UNNotificationPresentationOptions,
        notification: UNNotification
    ) -> UNNotificationPresentationOptions

    Parameters

    options

    The notification presentation options.

    notification

    The notification.

    Return Value

    a UNNotificationPresentationOptions enum value indicating the presentation options for the notification.

  • Called when a notification has arrived in the foreground and is available for display.

    Declaration

    Swift

    @objc(extendPresentationOptions:notification:completionHandler:)
    optional func extendPresentationOptions(
        _ options: UNNotificationPresentationOptions,
        notification: UNNotification,
        completionHandler: @escaping (UNNotificationPresentationOptions) -> Void
    )

    Parameters

    options

    The notification presentation options.

    notification

    The notification.

    completionHandler

    The completion handler.