Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not showing notification in Windows 10 #27

Open
royaldevbrat opened this issue Mar 1, 2022 · 5 comments
Open

Not showing notification in Windows 10 #27

royaldevbrat opened this issue Mar 1, 2022 · 5 comments

Comments

@royaldevbrat
Copy link

image
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)
}
}
`

@xiaobo9
Copy link

xiaobo9 commented Mar 29, 2022

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)
	}

@salomeldc
Copy link

salomeldc commented Apr 26, 2022

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)
	}
}`

@xiaobo9
Copy link

xiaobo9 commented Apr 26, 2022

@salomeldc Is there any error message? If there is, post it

@salomeldc
Copy link

exactly the same that devbrat : exit status 5

@zhongxiaohang
Copy link

我也遇到相同的问题,后来发现是系统没有开启通知设置
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants