Closed bo-brainlabs closed 7 years ago
I've not come across anyone experiencing this before. Maybe try unregistering the service worker and refreshing the page and going through it again, in case the service worker is just out of date.
Hi @gauntface I found that refreshing it didn't seem to work, but using your demo site https://gauntface.github.io/simple-push-demo/ works like a charm...
Actually pasting that link in the terminal created a push notification and displayed all the test push notifications that didn't previously work...
So it's almost as if the notifications were waiting to be triggered by something else. Any ideas?
I'll keep digging and hopefully find the problem when I fully understand how the service worker is doing it's thing.
It may be that Chrome was strugging to connect to GCM. Will close for now - but please comment if there is anything you discover that I should add or change to the codelab.
Thanks!
Having same issue following the same tutorial. The push button from Chrome dev tools does not work
I got the same problem now :(
Same issue, Button "Push" from DevTools not works ("focus" link button did not too)
Same issue :(
This issue has been reported as a bug in Developer Tools. https://github.com/GoogleChromeLabs/web-push-codelab/issues/49
Guys! It works on Google Canary: I have: v. 73.0.3628.0 (official version) canary (32-bits)
Hopefully this helps someone else who googles their way to this thread:
Notification.tag seems to behave differently between Firefox and Chrome. To see what I mean, visit this supremely helpful push notification examples site (thanks for creating that, @gauntface!) in Firefox and click the first demo button entitled 'Example Notification'. Close the notification that appears and click the button again. You should receive a second notification. Now, repeat that process in Chrome. Unless I'm missing something, you should only have received one notification that appears after the first click. Subsequent clicks don't cause more notifications to appear. Removing the tag
entry from the options hash (line 42 of notification-examples.js) causes the button to behave the same way in both Firefox and Chrome.
In conclusion, if you, like me, were confused as to why your push notifications weren't showing up in Chrome, check whether you're passing a tag in the options hash to RegistrationServiceWorker.showNotification()
.
Had the same issue on Apple MacPro. Had to authorize notification for Chrome in Apple System Preferences.
I've followed the tutorial up to the "Handle a push event section". At the end of this section, I click the chrome devtools "Push" button, but no push notification is displayed on screen. The service worker "sw.js" is executed as I can see the console log output and it reads:
But no push notification. I'm using a 2013 macbook air running 10.12.3 & Chrome version 57
Is this just something I've done wrong or is this a common problem?