Closed Qxcl closed 8 years ago
You might need to explain to me what's happening here, as in my testing, if the toast is not clicked, it shows up in the Action Center just fine. Sorry if I've missed something. And thanks for your contribution 😎
In my tests, notifications (at least those without any action buttons) will not remain in the Action Center after they disappear from the screen. Various posts on StackOverflow, MSDN, and personal blogs corroborate the existence of this issue with non-UWP and non-COM-registered apps.
Update: I have tested this in a sample app and oddly the notifications do stick in the Action Center, yet they did not in my win-toastd app. This appears to be one of those Heisenbugs.
Update2: After modifying the notification, it stopped persisting in the Action Center. My first test appeared to work at a glance by referencing a nonexistent Icon, but the notification was erroneously formed with the AppID
as the Title and New notification
as the Message.
Here is a sample program in which the notifications do not persist.
package main
import (
toast "github.com/jacobmarshall/go-toast"
"log"
)
func main() {
notification := toast.Notification{
AppID: "Test",
Title: "My notification",
Message: "Some message about how important something is...",
}
err := notification.Push()
if err != nil {
log.Fatalln(err)
}
}
I've just checked again, and these notifications seem to stay in the Action Center. May I ask, have you updated to Windows 10 Anniversary?
I have not updated to the Anniversary version. I'm Installing it now, and I'll let you know if that fixes everything. I thought I was all up to date, going by the Windows Update tool... 😞
I have quite a few queued up now. So I'm pretty sure it's working as expected on Windows 10 anniversary update. Please feel free to close the PR if you're happy with your own tests.
Thanks again for looking into it though. I do appreciate the contribution 👍
After updating I can confirm they are not staying in the Action Center by default.
I've found the per-app switches in the "Notifications & actions" Settings. It appears they are set to not show in the Action Center by default.
Since I've found this solution, this change may not be so necessary.
Mhmm, very interesting. "Show notifications in action center" is turned off by default for me too, however I see the notifications stack up in the Action Center regardless. So not too sure what this option is meant to do...
Thanks again.
Glad to contribute. Thanks for making this great package. 😄
+1 I can confirm that the notification is not persist in notification center on windows 10
Added field
Persist bool
to typeNotification
with accompanying logic inNotification.Push()
. This determines if a toast should remain in the Action Center after it times out.I think some people will find this option useful. 😺