| 1 | //go:build windows |
| 2 | |
| 3 | package notify |
| 4 | |
| 5 | import "git.sr.ht/~jackmordaunt/go-toast/v2" |
| 6 | |
| 7 | // PlatformSender delivers notifications through the Windows Toast API. |
| 8 | type PlatformSender struct{} |
| 9 | |
| 10 | // NewPlatformSender returns the best-effort sender for the current platform. |
| 11 | func NewPlatformSender() PlatformSender { |
| 12 | _ = toast.SetAppData(toast.AppData{AppID: "Reasonix"}) |
| 13 | return PlatformSender{} |
| 14 | } |
| 15 | |
| 16 | func (PlatformSender) Send(m Message) error { |
| 17 | notification := toast.Notification{ |
| 18 | AppID: "Reasonix", |
| 19 | Title: m.Title, |
| 20 | Body: m.Body, |
| 21 | } |
| 22 | return notification.Push() |
| 23 | } |
| 24 |