to-do-notifications: Not working on Android google chrome
For some reason the application doesn't seem to work with my browser and also there is no indication that a notification has been enabled
There was a bug (my fault). We fixed it earlier today. Can you double-check it works?
Some changes seems to have be implemented ,the todo item now get pretended to the body but a notification still wasn't sent. though it asked for notification permission when I clicked the allow notification button ,and I granted it
Thank you, there likely is a second problem. (I suspect the notification API evolved since this has been written). I'll try to dig this out.
Thank you, there likely is a second problem. (I suspect the notification API evolved since this has been written). I'll try to dig this out.
Will look up to that ,sir
So I got the notification on Firefox:

On Safari

It didn't work on Chrome Desktop (though it asked for permission).
(I hope that solving this on Desktop, as we can reproduce the problem there, will fix the problem on Android too)
Looks likes it is browser compatability issue
I've tried in Chrome with the Native notification flag on and off, no difference. The Notification is not displayed and fail silently.
Also when I add a show event handler, it displays the message as if the notification is shown (which is not):
notification.onshow = () => {
console.log('Notification shown');
};
I've not found anything on the Web about this. (Difficult to search for Notification API, a lot of noise…)
@jpmedley Could you find somebody who could help us? The code is fairly short and straightforward; a Web Notification API specialist will probably need only a few minutes of their time to understand it. I really would like to have this example work in Chrome (and maybe update our guides on MDN)
I ran into this a few weeks ago. The problem's not in the code. On mac, notifications need to be turned on at the OS level. I'm still trying to find out why. I'm told that this resets with every system upgrade, but I haven't confirmed this. There is no way to detect this condition in a script.
I'll keep you apprised with updates as I learn them.

You can find the code here https://github.com/mdn/dom-examples/tree/main/to-do-notifications
I ran into this a few weeks ago. The problem's not in the code. On mac, notifications need to be turned on at the OS level. I'm still trying to find out why. I'm told that this resets with every system upgrade, but I haven't confirmed this. There is no way to detect this condition in a script.
I'll keep you apprised with updates as I learn them.
Thanks
We're having trouble pinning down the precise cause of this. Here's what we think at this point.
Apple has changed its notification API for mac. The old one is still available but deprecated. We think that with the new one, if you decline the first notification request, all notifications are shut off at the os level for Chrome. I recently got a new work mac, so I mentioned that I must have accepted the first Firefox request and that's why notifications work in that app. Apparently it's also possible that Firefox has yet to upgrade to the new mac API. At this point, we just don't know.
@beverloo, please correct this if I've gotten anything wrong.
Thanks for digging into this. These would explain quite a lot of problems.
We are merging this repository into dom-examples. I will move this issue to dom-examples, so this conversation can continue there.
hi folks :) i'm going through some open MDN issues and this one popped up.
my latest understanding of this issue is:
- this issue is related to
dom-examples/to-do-notifications - this issue was opened because of a problem with this example on Chrome on Android
- folks learned that the example didn't work on Chrome on Desktop (on MacOS at least). a possible explanation of this problem is a failure to enable the necessary (and sometimes annoying) OS-level permissions for Chrome, preventing the notification from working at all.
i have a few questions:
- i tried this example on Chrome on Android (S22 Ultra) after verifying that both the site and Chrome have notification permissions, and i did not receive the notification - so it appears as though there's still a problem with the application code. does this match others' experiences?
- i have tried this example on Chrome on MacOS just now, ensuring that Chrome can show notifications at the OS level, and ensuring that notifications for the demo site are enabled. It worked!
so - is there still a problem with this example on MacOS Chrome?
if there is still a desire to fix this example on Android/Chrome, this issue should still be active. @teoli2003 - is this something that you would fix?
mentioning all involved: @schalkneethling @teoli2003 @jpmedley @im-ghost