<!--
{
  "availability" : [
    "iOS: 8.0.0 - 10.0.0",
    "iPadOS: 8.0.0 - 10.0.0",
    "macCatalyst: 13.1.0 - 13.1.0"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIUserNotificationAction",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIUserNotificationAction"
  },
  "title" : "UIUserNotificationAction"
}
-->

# UIUserNotificationAction

A custom action that your app can perform in response to a remote or local notification.

```
@MainActor class UIUserNotificationAction
```

## Overview

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`](/documentation/UIKit/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:)`](/documentation/UIKit/UIApplicationDelegate/application(_:handleActionWithIdentifier:forRemoteNotification:completionHandler:)) or [`application(_:handleActionWithIdentifier:for:completionHandler:)`](/documentation/UIKit/UIApplicationDelegate/application(_:handleActionWithIdentifier:for:completionHandler:)) method to perform the action.

## Topics

### Creating the action

[`-  init`](/documentation/UIKit/UIUserNotificationAction/init())

Creates a user notification action.

[`-  initWithCoder:`](/documentation/UIKit/UIUserNotificationAction/init(coder:))

Creates a user notification action from data in an unarchiver.

### Getting the action information

[`identifier`](/documentation/UIKit/UIUserNotificationAction/identifier)

The string that you use internally to identify the action.

[`title`](/documentation/UIKit/UIUserNotificationAction/title)

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

### Getting the action’s configuration

[`activationMode`](/documentation/UIKit/UIUserNotificationAction/activationMode)

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

[`authenticationRequired`](/documentation/UIKit/UIUserNotificationAction/isAuthenticationRequired)

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

[`destructive`](/documentation/UIKit/UIUserNotificationAction/isDestructive)

A Boolean value indicating whether the action is destructive.

[`behavior`](/documentation/UIKit/UIUserNotificationAction/behavior)

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

[`parameters`](/documentation/UIKit/UIUserNotificationAction/parameters)

A dictionary of additional parameters to include with the action.

### Constants

[`UIUserNotificationActivationMode`](/documentation/UIKit/UIUserNotificationActivationMode)

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

[`UIUserNotificationActionBehavior`](/documentation/UIKit/UIUserNotificationActionBehavior)

Constants indicating additional behavior that the action supports.

[Action Parameter Key](/documentation/UIKit/action-parameter-key)

Key to include among the parameters of the action.

[Behavior Key](/documentation/UIKit/behavior-key)

Key related to action-related behaviors.

## Relationships

### Conforms To

[`NSSecureCoding`](/documentation/Foundation/NSSecureCoding)

[`NSCopying`](/documentation/Foundation/NSCopying)

[`CVarArg`](/documentation/Swift/CVarArg)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Equatable`](/documentation/Swift/Equatable)

[`NSCoding`](/documentation/Foundation/NSCoding)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`Sendable`](/documentation/Swift/Sendable)

[`Hashable`](/documentation/Swift/Hashable)

[`NSMutableCopying`](/documentation/Foundation/NSMutableCopying)

### Inherited By

[`UIMutableUserNotificationAction`](/documentation/UIKit/UIMutableUserNotificationAction)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)