electron-archive/brightray

Quiting Electron application should remove presented notifications on Mac

miniak opened this issue · 0 comments

[[NSUserNotificationCenter defaultUserNotificationCenter] removeAllDeliveredNotifications] should be called when an Electron application quits to remove all presented notifications. The reason is that when the application restarts by clicking the notification, it is not possible to react on the onclick events, as the JavaScript Notification object is gone.

Therefore:

  • it should either be possible to handle the notification when the application starts (NSApplicationLaunchUserNotificationKey passed to [NSApplicationDelegate applicationDidFinishLaunching])
  • or just remove all the notifications when the application is not running