toast
toast copied to clipboard
Not showing notification in Windows 10
Notification not showing up
` package main
import ( "log" toast "gopkg.in/toast.v1" )
func main() { notification := toast.Notification{ AppID: "Example AppID", Title: "My notification", Message: "Some message about how important something is...", Icon: "C:\Users\noti\icon.png", // This file must exist (remove this line if it doesn't) Actions: []toast.Action{ {"protocol", "I'm a button", ""}, {"protocol", "Me too!", ""}, }, } err := notification.Push() if err != nil { log.Fatalln(err) } } `
icon path should be C:\\Users\\noti\\icon.png
not C:\Users\noti\icon.png
notification := toast.Notification{
AppID: "Example AppID",
Title: "My notification",
Message: "Some message about how important something is...",
Icon: "C:\\Users\\noti\\icon.png", // This file must exist (remove this line if it doesn't)
Actions: []toast.Action{
{"protocol", "I'm a button", ""},
{"protocol", "Me too!", ""},
},
}
err := notification.Push()
if err != nil {
log.Fatalln(err)
}
Hi, I have the same issue. There is my code
package main
import (
"log"
"gopkg.in/toast.v1"
)
func main() {
notification := toast.Notification{
AppID: "ExampleApp",
Title: "My notification",
Message: "Some message about how important something is...",
Icon: "C:\\project\\notification\\notification\\assets\\icon.png",
Actions: []toast.Action{
{Type: "protocol", Label: "I'm a button", Arguments: ""},
{Type: "protocol", Label: "Me too!", Arguments: ""},
},
}
err := notification.Push()
if err != nil {
log.Fatalln(err)
}
}`
@salomeldc Is there any error message? If there is, post it
exactly the same that devbrat : exit status 5
我也遇到相同的问题,后来发现是系统没有开启通知设置