A type of notification that your app supports and the custom actions to display with it.
- iOS 10.0+
- macOS 10.14+
- watchOS 3.0+
UNNotification object defines a type of notification that your executable can receive. You create category objects to define your app's actionable notifications—that is, notifications that have action buttons that the user can select in response to the notification. Each category object you create stores the actions and other behaviors associated with a specific type of notification. Register your category objects using the
set method of
UNUser. You can register as many category objects as you want.
To apply category objects to your notifications, include the category’s identifier string in the payload of any notifications you create. For local notifications, put this string in the
category property of the
UNMutable object that you use to specify the notification’s content. For remote notifications, use this string as the value of the
category key in the
aps dictionary of your payload.
Categories can have associated actions, which define custom buttons to display for notifications of that category. When space is unlimited, the system displays up to 10 actions. When space is limited, the system displays at most two actions.