UAPushNotificationDelegate

@protocol UAPushNotificationDelegate <NSObject>

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

  • Called when a notification is received in the foreground.

    Declaration

    Objective-C

    - (void)receivedForegroundNotification:
                (nonnull UANotificationContent *)notificationContent
                         completionHandler:
                             (nonnull void (^)(void))completionHandler;

    Swift

    optional func receivedForegroundNotification(_ notificationContent: UANotificationContent, completionHandler: @escaping () -> Void)

    Parameters

    notificationContent

    UANotificationContent object representing the notification info.

    completionHandler

    the completion handler to execute when notification processing is complete.

  • Called when a notification is received in the background.

    Declaration

    Objective-C

    - (void)receivedBackgroundNotification:
                (nonnull UANotificationContent *)notificationContent
                         completionHandler:
                             (nonnull void (^)(UIBackgroundFetchResult))
                                 completionHandler;

    Swift

    optional func receivedBackgroundNotification(_ notificationContent: UANotificationContent, completionHandler: @escaping (UIBackgroundFetchResult) -> Void)

    Parameters

    notificationContent

    UANotificationContent object representing the notification info.

    completionHandler

    the completion handler to execute when notification processing is complete.

  • 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

    Objective-C

    - (void)receivedNotificationResponse:
                (nonnull UANotificationResponse *)notificationResponse
                       completionHandler:(nonnull void (^)(void))completionHandler;

    Swift

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

    Parameters

    notificationResponse

    UANotificationResponse 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.

    @deprecated Deprecated - to be removed in SDK version 13.0. Please use extendPresentationOptions:notification:

    Declaration

    Objective-C

    - (UNNotificationPresentationOptions)presentationOptionsForNotification:
        (nonnull UNNotification *)notification;

    Swift

    optional func presentationOptions(for notification: UNNotification) -> UNNotificationPresentationOptions

    Parameters

    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

    Objective-C

    - (UNNotificationPresentationOptions)
        extendPresentationOptions:(UNNotificationPresentationOptions)options
                     notification:(nonnull UNNotification *)notification;

    Swift

    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.