Added web-push and system-push notifications

This commit is contained in:
Данил 2023-05-01 20:47:25 +03:00
parent 6cbe10e9c2
commit 37595d6236
No known key found for this signature in database
GPG key ID: 5051BCD5AB064A7B

20
utils/notify.go Normal file
View file

@ -0,0 +1,20 @@
package utils
import "gopkg.in/toast.v1"
func Notify(title, message string, action toast.Action) {
notification := toast.Notification{
AppID: "EveryNASA",
Title: title,
Message: message,
Duration: toast.Long,
Actions: []toast.Action{
action,
},
}
err := notification.Push()
if err != nil {
panic(err)
}
}