mirror of
https://github.com/Starlio-app/StarlioX
synced 2024-11-05 06:03:57 +03:00
Added web-push and system-push notifications
This commit is contained in:
parent
6cbe10e9c2
commit
37595d6236
1 changed files with 20 additions and 0 deletions
20
utils/notify.go
Normal file
20
utils/notify.go
Normal 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)
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue