Class

UNNotificationResponse

The user’s response to an actionable notification.

Overview

When the user interacts with a delivered notification, the system delivers a UNNotificationResponse object to your app so that you can process the response. Users can interact with delivered notifications in many ways. If the notification’s category had associated action buttons, they can select one of those buttons. Users can also dismiss the notification without selecting one of your actions and they can open your app. A response object tells you which option that the user selected.

You do not create instances of this class yourself. Instead, the notification center object creates instances and delivers them to the userNotificationCenter(_:didReceive:withCompletionHandler:) method of its delegate object. You use that method to extract any needed information from the response objects and take appropriate actions. For more information about implementing the notification center delegate, see UNUserNotificationCenterDelegate.

Topics

Getting the Response Information

var actionIdentifier: String

The identifier for the action that the user selected.

var notification: UNNotification

The notification to which the user responded.

Constants

System-Defined Action Identifiers

Constants for system-defined actions.

Relationships

Inherits From

See Also

Notifications

class UNNotificationRequest

An object you use to specify a notification’s content and the condition that triggers its delivery.

class UNNotification

The data for a delivered notification.