toast icon indicating copy to clipboard operation
toast copied to clipboard

Not showing notification in Windows 10

Open royaldevbrat opened this issue 2 years ago • 5 comments

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

royaldevbrat avatar Mar 01 '22 11:03 royaldevbrat

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

xiaobo9 avatar Mar 29 '22 04:03 xiaobo9

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 avatar Apr 26 '22 12:04 salomeldc

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

xiaobo9 avatar Apr 26 '22 12:04 xiaobo9

exactly the same that devbrat : exit status 5

salomeldc avatar Apr 26 '22 14:04 salomeldc

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

zhongxiaohang avatar Sep 11 '23 07:09 zhongxiaohang