gen2brain / beeep

Go cross-platform library for sending desktop notifications, alerts and beeps
BSD 2-Clause "Simplified" License
1.42k stars 88 forks source link

Support for closing notifications #56

Open delthas opened 11 months ago

delthas commented 11 months ago

https://specifications.freedesktop.org/notification-spec/notification-spec-latest.html

Taken from the spec:

org.freedesktop.Notifications.CloseNotification

void org.freedesktop.Notifications.CloseNotification ( | ); |   -- | -- | --
UINT32 id;
 

Causes a notification to be forcefully closed and removed from the user's view. It can be used, for example, in the event that what the notification pertains to is no longer relevant, or to cancel a notification with no expiration time.

delthas commented 11 months ago

Example use case: IM app, should clear the notificaiton when the particular channel containing the message causing the notification is seen

gen2brain commented 11 months ago

Is it supported in Windows, macOS, and in browsers?

delthas commented 11 months ago

Windows: yes (but needs support in the toast library, see linked issue)

Browsers: yes: https://developer.mozilla.org/en-US/docs/Web/API/Notification/close

MacOS: seems to be difficult at first glance