A task to perform in response to a delivered notification.


@interface UNNotificationAction : NSObject


Use UNNotificationAction objects to define the actions that your app can perform in response to a delivered notification. You define the actions that your app supports. For example, a meeting app might define actions for accepting or rejecting a meeting invitation. The action object itself contains the title to display in an action button and the button's appearance. After creating action objects, add them to a UNNotificationCategory object and register your categories with the system.

For information on how to define actions and categories, see Declaring Your Actionable Notification Types.

Responding to the Selection of Actions

When the user selects one of your actions in response to a notification, the system notifies the delegate of the shared UNUserNotificationCenter object. Specifically, the system calls the userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler: method of your delegate object. The response object passed to your delegate includes the identifier string of the action that was selected, which you can use to perform the corresponding task.

For information on how to handle actions, see Handling Notifications and Notification-Related Actions.


Creating an Action

+ actionWithIdentifier:title:options:

Creates an action object with the specified title and options.

Getting the Action Information


The unique string that your app uses to identify the action.


The localized string to use as the title of the action.

Getting the Action Options


The behaviors associated with the action.


The action has the default behavior.


The behaviors you can apply to an action.


Inherits From

See Also

Notification Categories and User Actions

Declaring Your Actionable Notification Types

Differentiate your notifications and add action buttons to the notification interface.


A type of notification that your app supports and the custom actions to display with it.


An action that can accept user-typed text.