Xojo Conferences

Platforms to show: All Mac Windows Linux Cross-Platform

UNNotificationActionMBS class

Type Topic Plugin Version macOS Windows Linux Console & Web iOS
class User Notifications MBS MacFrameworks Plugin 19.1 Yes No No Yes, macOS only No
Function: The class for an action for a notification.
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.

When the user selects one of your actions in response to a notification, the system notifies the delegate of the shared UNUserNotificationCenterMBS object. Specifically, the system calls the didReceiveNotificationResponse event. 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.

Feedback, Comments & Corrections

  • 4 properties
  • 2 methods
    • method Constructor(identifier as string, title as string, options as integer)
    • method copy as UNNotificationActionMBS
  • 2 shared methods
    • shared method action(identifier as string, title as string, options as integer) as UNNotificationActionMBS
    • shared method Available as boolean
  • 4 constants


Constant Value Description
OptionAuthenticationRequired 1 The action can be performed only on an unlocked device.
When the user selects an action with this option, the system prompts the user to unlock the device. After unlocking, the system notifies your app of the selected action. You might use option to perform actions that require accessing data that is encrypted while the device is locked.
OptionDestructive 2 The action performs a destructive task.
Use this option for actions that delete user data or change the app irrevocably. The action button is displayed with special highlighting to indicate that it performs a destructive task.
OptionForeground 4 The action causes the app to launch in the foreground.
When the user selects an action containing this option, the system brings the app to the foreground, asking the user to unlock the device as needed. Use this option for actions that require the user to interact further with your app. Do not use this option simply to bring your app to the foreground.
OptionNone 0 The action has the default behavior.

Sub classes:

Some methods using this class:

The items on this page are in the following plugins: MBS MacFrameworks Plugin.

UNMutableNotificationContentMBS   -   UNNotificationAttachmentMBS

MBS Xojo Chart Plugins