Platforms to show: All Mac Windows Linux Cross-Platform
NSUserNotificationCenterMBS class Deprecated
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | User Notifications | MBS MacFrameworks Plugin | 12.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
When a user notifications is delivery date has been reached, or it is manually delivered, the notification center it may display the notification to the user. The user notification center reserves the right to decide if a delivered user notification is presented to the user. For example, it may suppress the notification if the application is already frontmost (the delegate can override this action). The application can check the result of this decision by examining the presented property of a delivered user notification.
NSUserNotificationMBS instances the NSUserNotificationCenterMBS are tracking will be in one of two states: scheduled or delivered. A scheduled user notification has a deliveryDate. On that delivery date, the notification will move from being scheduled to being delivered. Note that the user notification may be displayed later than the delivery date depending on a number of factors.
A delivered user notification has an actualDeliveryDate. That is the date when it moved from being scheduled to delivered, or when it was manually delivered using the deliverNotification method.
The application and the user notification center are both ultimately subject to the user's preferences. If the user decides to hide all alerts from your application, the presented property will still behave as above, but the user will not see any animation or hear any sound.
The NSUserNotificationCenterDelegateMBS class provides more information about the delivered user notification and allows forcing the display of a user notification even if the application is frontmost.
Note: It the user wakes more than 15 minutes after a scheduled notification is scheduled to fire, it is discarded. If the notification repeats with an interval less than 15 minutes, then it expires in 1 minute. Expired notifications are just discarded, unless they repeat, in which case, they stay in the scheduled list and just fire again later.
Important Many of the NSUserNotificationCenterMBS class's methods involve talking to a server process, so calling them repeatedly can have a negative effect on performance.
This is for sending user notifications to the Mac your Xojo application runs on. Not for remote notifications or notifications to iOS devices.
The NSUserNotificationCenterMBS class and the NSUserNotificationMBS class are both thread safe.
- property Handle as Integer
- 9 methods
- method Constructor
- method deliveredNotifications as NSUserNotificationMBS()
- method deliverNotification(notification as NSUserNotificationMBS)
- method removeAllDeliveredNotifications
- method removeAllScheduledNotifications
- method removeDeliveredNotification(notification as NSUserNotificationMBS)
- method removeScheduledNotification(notification as NSUserNotificationMBS)
- method scheduledNotifications as NSUserNotificationMBS()
- method scheduleNotification(notification as NSUserNotificationMBS)
- 2 shared methods
- shared method Available as boolean
- shared method defaultUserNotificationCenter as NSUserNotificationCenterMBS
This class has no sub classes.
Some events using this class:
- NSUserNotificationCenterDelegateMBS.didActivateNotification(center as NSUserNotificationCenterMBS, notification as NSUserNotificationMBS)
- NSUserNotificationCenterDelegateMBS.didDeliverNotification(center as NSUserNotificationCenterMBS, notification as NSUserNotificationMBS)
- NSUserNotificationCenterDelegateMBS.shouldPresentNotification(center as NSUserNotificationCenterMBS, notification as NSUserNotificationMBS) as boolean
Some examples using this class:
Blog Entries
- MBS Xojo Plugins, version 20.6pr1
- MBS Xojo Plugins, version 19.2pr3
- Mac OS X 10.8 User Notifications with Filemaker and Real Studio
Release notes
- Version 21.0
- Deprecated NSUserNotificationCenterMBS in favor of UNUserNotificationCenterMBS class.
- Version 19.2
- Added removeAllScheduledNotifications method to NSUserNotificationCenterMBS class.
The items on this page are in the following plugins: MBS MacFrameworks Plugin.
NSUserNotificationCenterDelegateMBS - NSUserNotificationMBS