desktop_toast_darwin.go 366 B

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