The user’s response to an actionable notification.
SDKs
- iOS 10.0+
- macOS 10.14+
- Mac Catalyst 13.0+
- watchOS 3.0+
Framework
- User
Notifications
Declaration
@interface UNNotificationResponse : NSObject
Overview
When the user interacts with a delivered notification, the system delivers a UNNotification
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 the user selected.
You don't create UNNotification
objects yourself. Instead, the shared user notification center object creates them and delivers them to the user
method of its delegate object. Use that method to extract any needed information from the response object and take appropriate action.
For more information about responding to actions, see Handling Notifications and Notification-Related Actions.