Platforms to show: All Mac Windows Linux Cross-Platform
UNUserNotificationCenterMBS class
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| class | User Notifications | MBS MacFrameworks Plugin | 19.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
see also
https://developer.apple.com/documentation/usernotifications/unusernotificationcenter?language=objc
- 9 events
- event addNotificationRequestCompleted(request as UNNotificationRequestMBS, error as NSErrorMBS, tag as variant)
- event didReceiveNotificationResponse(response as UNNotificationResponseMBS)
- event getDeliveredNotificationsCompleted(notifications() as UNNotificationMBS, tag as variant)
- event getNotificationCategoriesCompleted(categories() as UNNotificationCategoryMBS, tag as variant)
- event getNotificationSettingsCompleted(settings as UNNotificationSettingsMBS, tag as variant)
- event getPendingNotificationRequestsCompleted(requests() as UNNotificationRequestMBS, tag as variant)
- event openSettingsForNotification(notification as UNNotificationMBS)
- event requestAuthorizationCompleted(granted as boolean, error as NSErrorMBS, tag as variant)
- event willPresentNotification(notification as UNNotificationMBS, byref options as Integer)
- 2 properties
- property Handle as Integer
- property supportsContentExtensions as Boolean
- 13 methods
- method addNotificationRequest(request as UNNotificationRequestMBS, tag as Variant = nil)
- method Constructor
- method Destructor
- method getDeliveredNotifications(tag as Variant = nil)
- method getNotificationCategories(tag as Variant = nil)
- method getNotificationSettings(tag as Variant = nil)
- method getPendingNotificationRequests(tag as Variant = nil)
- method removeAllDeliveredNotifications
- method removeAllPendingNotificationRequests
- method removeDeliveredNotifications(identifiers() as string)
- method removePendingNotificationRequests(identifiers() as string)
- method requestAuthorization(options as integer, tag as Variant = nil)
- method setNotificationCategories(categories() as UNNotificationCategoryMBS)
- shared method Available as boolean
- 15 constants
Authorization Options
| Constant | Value | Description |
|---|---|---|
| AuthorizationOptionAlert | 4 |
The ability to display alerts. |
| AuthorizationOptionAnnouncement | 128 |
The ability for Siri to automatically read out messages over AirPods. |
| AuthorizationOptionBadge | 1 |
The ability to update the app’s badge. |
| AuthorizationOptionCarPlay | 8 |
The ability to display notifications in a CarPlay environment. |
| AuthorizationOptionCriticalAlert | 16 | The ability to play sounds for critical alerts. more |
| AuthorizationOptionNone | 0 |
No options. |
| AuthorizationOptionProvidesAppNotificationSettings | 32 |
An option indicating the system should display a button for in-app notification settings. |
| AuthorizationOptionProvisional | 64 |
The ability to post noninterrupting notifications provisionally to the Notification Center. |
| AuthorizationOptionSound | 2 |
The ability to play sounds. |
Notification Presentation
| Constant | Value | Description |
|---|---|---|
| NotificationPresentationOptionAlert | 4 |
Display the alert using the content provided by the notification. |
| NotificationPresentationOptionBadge | 1 | Apply the notification's badge value to the app’s icon. more |
| NotificationPresentationOptionBanner | 16 |
New for macOS 11.0 |
| NotificationPresentationOptionList | 8 |
New for macOS 11.0 |
| NotificationPresentationOptionNone | 0 |
No alert. Specify this constant when you want to silence any user interactions for a notification. |
| NotificationPresentationOptionSound | 2 |
Play the sound associated with the notification. |
This class has no sub classes.
Blog Entries
Release notes
- Version 21.0
- Deprecated NSUserNotificationCenterMBS in favor of UNUserNotificationCenterMBS class.
- Version 19.2
- Fixed problem with UNUserNotificationCenterMBS constructor, too.
Some examples using this class:
Some related classes:
- class NSErrorMBS
- class NSUserNotificationCenterMBS
- class UNNotificationCategoryMBS
- class UNNotificationMBS
- class UNNotificationRequestMBS
- class UNNotificationResponseMBS
- class UNNotificationSettingsMBS
The items on this page are in the following plugins: MBS MacFrameworks Plugin.
UNTimeIntervalNotificationTriggerMBS - UnZipFileInfoMBS