Windows-10-Toast-Notifications
Windows-10-Toast-Notifications copied to clipboard
The notifications don't work in the latest update of Windows 10
Hi,
I've been using this library for a long time and never had any problems. Recently I let Windows update with it's latest update, and right after that I stopped getting notification from my program. I tested this by creating a simple python file with only the sample code of this library and again the notification didn't popup. I noticed whenever the notification was supposed to popup it will only show an icon in the system tray and not show the notification.
I suspect this has to do with Windows' feature of "Focus Assist" that I only noticed recently. I also noticed that there is a white-list of programs in the "Notifications & Actions" section of Settings, where you can enable or disable notifications from certain programs and sources, which I'm not sure was there before.
Would really appreciate a feedback on this as this library is very crucial for my application.
Thank you.
Try this:
- Open settings with Windows Key + i
- Navigate to Privacy > Background Apps
- Toggle on Let apps run in the background and then Reboot your computer. However, if it is already toggled on, toggle it off, and then turn it back on.
Solution from: https://www.thewindowsclub.com/notifications-missing-from-action-center
Hope this helps.
I am using this. It works perfectly. You can assign any string to appid, that would become the name of the notifications but I can't seem to figure out how to clear out the notifications or make python listen for the click event It is supported by MS and can work in lastest update refer https://docs.microsoft.com/en-us/windows/uwp/design/shell/tiles-and-notifications/toast-ux-guidance
from winrt.windows.ui.notifications import ToastNotificationManager, ToastNotification
import winrt.windows.data.xml.dom as dom
appid=r'C:\Users\HP\AppData\Local\Programs\Python\Python38\python.exe'
notifier = ToastNotificationManager.create_toast_notifier(appid)
tString = """<toast duration='short'><audio src = 'ms-winsoundevent:Notification.Reminder' loop = 'false' silent = 'false'/><visual><binding template='ToastText02'><text id="1">""" + title + """</text><text id="2">""" + desp + """</text></binding></visual></toast>"""
xDoc = dom.XmlDocument()
xDoc.load_xml(tString)
notifier.show(ToastNotification(xDoc))