Protocol

UNUserNotificationCenterDelegate

The interface for handling incoming notifications and notification-related actions.

Declaration

@protocol UNUserNotificationCenterDelegate

Overview

Use the methods of the UNUserNotificationCenterDelegate protocol to handle user-selected actions from notifications, and to process notifications that arrive when your app is running in the foreground. After implementing these methods in an object, assign that object to the delegate property of the shared UNUserNotificationCenter object. The user notification center object calls the methods of your delegate at appropriate times.

For information about the shared user notification center object, see UNUserNotificationCenter.

Topics

First Steps

Handling Notifications and Notification-Related Actions

Respond to user interactions with the system’s notification interfaces, including handling your app's custom actions.

Handling the Selection of Custom Actions

- userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler:

Asks the delegate to process the user's response to a delivered notification.

Receiving Notifications

- userNotificationCenter:willPresentNotification:withCompletionHandler:

Asks the delegate how to handle a notification that arrived while the app was running in the foreground.

UNNotificationPresentationOptions

Constants indicating how to present a notification in a foreground app.

Displaying Notification Settings

- userNotificationCenter:openSettingsForNotification:

Asks the delegate to display the in-app notification settings.

Relationships

Inherits From

See Also

Notification Management

UNUserNotificationCenter

The central object for managing notification-related activities for your app or app extension.

UNNotificationSettings

The object for managing notification-related settings and the authorization status of your app.