desktop_toast_darwin.go 385 B

12345678910111213141516171819
  1. //go:build darwin
  2. package notifications
  3. import (
  4. gosxnotifier "github.com/deckarep/gosx-notifier"
  5. )
  6. func sendDesktopNotification(title string, body string, image string, playSound bool, _ int) error {
  7. notify := gosxnotifier.NewNotification(body)
  8. notify.Title = title
  9. notify.ContentImage = image
  10. if playSound {
  11. notify.Sound = gosxnotifier.Default
  12. }
  13. return notify.Push()
  14. }