refactor: use the new NotificationFramework for pushing notifications#56
refactor: use the new NotificationFramework for pushing notifications#56nicholaswmin wants to merge 1 commit intovjeantet:masterfrom
Conversation
Fixes vjeantet#52 Replace `NSUserNotification` API with `UserNotifications.frameworks` API. * Import `UserNotifications/UserNotifications.h` in `alerter/AppDelegate.h` and `alerter/AppDelegate.m`. * Conform to `UNUserNotificationCenterDelegate` instead of `NSUserNotificationCenterDelegate` in `alerter/AppDelegate.h`. * Replace `NSUserNotification` with `UNNotificationRequest` for creating notifications in `alerter/AppDelegate.m`. * Replace `NSUserNotificationCenter` delegate methods with `UNUserNotificationCenter` delegate methods in `alerter/AppDelegate.m`. * Update methods to use `UNUserNotificationCenter` for managing notifications in `alerter/AppDelegate.m`. * Remove references to `NSUserNotification` in `alerter/main.m`.
|
What's the status of this PR? Is it ready to be merged? If I pull this down, can I build it and use it with the new MacOS notification API? What about code signing? Is that something I need to read up on? I've never have to deal with that before. |
|
@Tobbe Hi Tobbe; sorry for the late reply - should be good. No code-signing. |
|
No worries at all about the reply. Thanks for getting back to me 🙏 |
|
@nicholaswmin this doesn't seem to build for me: |
|
Hello, I've been investigating the use of this new API over the past few months. The biggest issue is the loss of features (sender, ignoresDoNotDisturb, dynamic buttons, dynamic image...) and the need to restructure the app as a .app bundle rather than a simple CLI executable to make the new framework work. 😢 |
Fixes #52
Replace
NSUserNotificationAPI withUserNotifications.frameworksAPI.UserNotifications/UserNotifications.hinalerter/AppDelegate.handalerter/AppDelegate.m.UNUserNotificationCenterDelegateinstead ofNSUserNotificationCenterDelegateinalerter/AppDelegate.h.NSUserNotificationwithUNNotificationRequestfor creating notifications inalerter/AppDelegate.m.NSUserNotificationCenterdelegate methods withUNUserNotificationCenterdelegate methods inalerter/AppDelegate.m.UNUserNotificationCenterfor managing notifications inalerter/AppDelegate.m.NSUserNotificationinalerter/main.m.