desktop_toast_darwin.go 421 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. notification := gosxnotifier.NewNotification(message)
  8. notification.Title = title
  9. notification.ContentImage = image
  10. if playSound {
  11. notification.Sound = gosxnotifier.Default
  12. }
  13. return notification.Push()
  14. }