Important: UIUserNotificationAction is deprecated in iOS 10. Use UNNotificationAction instead. A UIUserNotificationAction object represents a custom action that your app can perform in response to a remote or local notification.


@interface UIUserNotificationAction : NSObject


When a notification is delivered, the system displays a button for each custom action associated with the notification. Tapping a button launches your app (either in the foreground or background) and gives you a chance to perform the indicated action. You use this class to specify the text that is displayed in the button and the information your app needs to perform the corresponding action.

Typically, you create an instance of the UIMutableUserNotificationAction class instead of this class. You use the mutable object to configure the action and then call the setActions:forContext: method of UIMutableUserNotificationActionSettings to add the resulting actions to a group.

For each action you define, you must specify whether execution of that action requires the app to be running in the foreground or background. You can also specify whether the device must be unlocked or can remain locked while the action is performed. Unlocking the device may be necessary if the action involves reading or writing files that are encrypted on disk using the system’s data protection mechanism. When the user selects an action, the system puts your app into the appropriate mode and calls your app delegate’s application:handleActionWithIdentifier:forRemoteNotification:completionHandler: or application:handleActionWithIdentifier:forLocalNotification:completionHandler: method to perform the action.


Getting the Action Information


The string that you use internally to identify the action.


The localized string to use as the button title for the action.

Getting the Action’s Configuration


The mode in which to run the app when the action is performed.


A Boolean value indicating whether the user must unlock the device before the action is performed.


A Boolean value indicating whether the action is destructive.


The custom behavior (if any) that the action supports.


A dictionary of additional parameters to include with the action.



Constants indicating whether the app should activate to the foreground or background.


Constants indicating additional behavior that the action supports.

Action Parameter Key

Key to include among the parameters of the action.

Behavior Key

Key related to action-related behaviors.


Inherits From

See Also

Deprecated Classes


A preview action, or peek quick action, that is displayed below a peek when a user swipes the peek upward.


A group of one or more child quick actions, each an instance of the UIPreviewAction class.


An instance of the UIAcceleration class, called an acceleration event, represents immediate, three-dimensional acceleration data. To receive accelerometer events, register an application object as a delegate of the shared UIAccelerometer object, as described in UIAccelerometer.


The UIAccelerometer class lets you register to receive acceleration-related data from the onboard hardware. As a device moves, its hardware reports linear acceleration changes along the primary axes in three-dimensional space. You can use this data to detect both the current orientation of the device (relative to the ground) and any instantaneous changes to that orientation. You might use instantaneous changes as input to a game or to initiate some action in your application.


Important: UIActionSheet is deprecated in iOS 8. (Note that UIActionSheetDelegate is also deprecated.) To create and manage action sheets in iOS 8 and later, instead use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet.


In apps that run in versions of iOS prior to iOS 8, use the UIAlertView class to display an alert message to the user. An alert view functions similar to but differs in appearance from an action sheet (an instance of UIActionSheet).


A list of all the available document providers for a given file type and mode, in addition to custom menu items that you add.


Important:UILocalNotification is deprecated in iOS 10. Use UNNotificationRequest instead. A UILocalNotification object specifies a notification that an app can schedule for presentation at a specific date and time.


Important: UIMutableUserNotificationAction is deprecated in iOS 10. Use UNNotificationAction instead. A UIMutableUserNotificationAction object represents a modifiable version of the UIUserNotificationAction class.


Important: UIMutableUserNotificationCategory is deprecated in iOS 10. Use UNNotificationCategory instead. A UIMutableUserNotificationCategory object encapsulates information about custom actions that your app can perform in response to a local or push notification. Use instances of this class to customize the actions included in an alert when space onscreen is constrained.


Important: UIPopoverController is deprecated in iOS 9. In iOS 9 and later, a popover is implemented as a UIViewController presentation. To create a popover, use an instance of UIPopoverPresentationController and specify the UIModalPresentationPopover style.


Important: UISearchDisplayController is deprecated in iOS 8. (Note that UISearchDisplayDelegate is also deprecated.) To manage the presentation of a search bar and display search results in iOS 8 and later, instead use UISearchController.


The UIStoryboardPopoverSegue class defines a specific type of segue for presenting content in a popover. For popover segues, the destination view controller contains the content to be displayed in the popover. This class provides an additional popoverController property so that your custom code has access to the popover controller object. For example, you might want to store the popover controller elsewhere in your code so that you can dismiss the popover programmatically.


Important:UIUserNotificationCategory is deprecated in iOS 10. Use UNNotificationCategory instead. A UIUserNotificationCategory object encapsulates information about custom actions that your app can perform in response to a local or push notification.


Important: UIUserNotificationSettings is deprecated in iOS 10. Use UNNotificationSettings instead. A UIUserNotificationSettings object encapsulates the types of notifications that can be displayed to the user by your app.