Sounds like a good ideadeseven wrote:I think i'm going to write a module so everyone can use native OS X notifications easily.
Notification
Re: Notification
Windows (x64)
Raspberry Pi OS (Arm64)
Raspberry Pi OS (Arm64)
Re: Notification
Nice workdeseven wrote:Done. Wrapped everything into one module, added support for custom event data.
github, direct link
Are you familiar with NSMutableDictionary ?
You could have used it instead of NSDictionary like this
Code: Select all
options = CocoaMessage(0, 0, "NSMutableDictionary dictionaryWithCapacity:", 0)
CocoaMessage(0, options, "setObject:", CocoaMessage(0,0,"NSNumber numberWithInteger:", *notification\alwaysShow), "forKey:$", @"alwaysShow")
CocoaMessage(0, options, "setObject:", CocoaMessage(0,0,"NSNumber numberWithInteger:", *notification\deleteAfterClick), "forKey:$", @"deleteAfterClick")
...
Windows (x64)
Raspberry Pi OS (Arm64)
Raspberry Pi OS (Arm64)
Re: Notification
Nope, i saw NSDictionary here and moved on from that. Didn't know that NSMutableDictionary is a subclass of NSDictionary.
Updated the code, thanks
Updated the code, thanks
Re: Notification
By the way, NSUserNotification was deprecated and now you should use UNUserNotification instead. It's even more unfriendly and honestly it's much easier to just use terminal-notifier.
Naturally, my module above is also deprecated and won't receive any updates.
Naturally, my module above is also deprecated and won't receive any updates.