It's possible to send notifications to the Notification Center on Mac using NSUserNotification and NSUserNotificationCenter API classes.
But is there any way of reading the notifications from the Notification Center?
There is no public API for that. So nothing App Store conform.
BUT
As part of my little tech-demo-app DiscoNotifier (where I flash the keyboard LEDs in response to a notification) I wrote a DDUserNotificationCenterMonitor class
see: https://github.com/Daij-Djan/DiscoNotifier/tree/master/DiscoNotifier
it works using FileSystemEvents and SQLite and checks the notification center's database
It works and the database has all info (table: presented_notifications) but.. this is fragile AND private
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With