Open woj-tek opened 3 years ago
I agree this is not documented well at the moment. If I remember correctly this can only be set once, and therefore mac-notification-sys prevents you from setting it again. @h4llow3En didn't this result in a crash when setting the application more than once?
This is correct. The the NSUserNotification Framework only throws an Exception if you want to change the bundle identifier when it has been set before.
OK, so we know the cause. But how do we then generate multiple notifications from the same bundle? Currently each call to send_notification()
overrides previous notification (i.e. it's not possible to have 3 notifications displayed at the same time)
The actual displaying of the notification is not part of this crate. Since all notifications are only scheduled in the Nofitications API (all notifications, not just from this crate) macOS itself handles those. You can schedule x notifications right after another but macOS itself delays them. At least in the NSNotifications framework there is no possibility to display two notifications in the same app simultaneously. But if I remember it correctly, no Application is allowed to do this.
The newer Notifications are displayed after the previous disappear.
First, the source:
There are two issues here: 1) the bundle doesn't seem to be set (notification still comes from "terminal", which is later on confirmed by (2) 2) it's not possible to set the application name twice (or, to have notification not override themselves, i.e. generate a couple of notifications that would be displayed at the same time):