niotify/niotify_darwin.go

26 lines
496 B
Go
Raw Normal View History

2020-06-26 21:29:29 -04:00
package niotify
import (
"git.sr.ht/~whereswaldon/niotify/macos"
)
type macosManager struct {
channel macos.NotificationChannel
}
func newManager() (Manager, error) {
c := macos.NewNotificationChannel("Gio App")
2020-06-26 21:29:29 -04:00
return Manager{
&macosManager{ channel: c },
}, nil
}
func (a *macosManager) CreateNotification(title, text string) (*Notification, error) {
notification, err := a.channel.Send(title, text)
if err != nil {
return nil, err
}
return &Notification{notification}, nil
}