flauc / ng-push

An Angular wrapper around the Notifications API
MIT License
59 stars 12 forks source link

Phone notifications broken - Illegal constructor. Use ServiceWorkerRegistration.showNotification() instead. #10

Open SpaceMonkeyForever opened 6 years ago

SpaceMonkeyForever commented 6 years ago
ERROR TypeError: Failed to construct 'Notification': Illegal constructor. Use ServiceWorkerRegistration.showNotification()

This happens on mobile. Chrome on Android to be specific.

Explanation here: https://stackoverflow.com/a/29915743/331021

I think the library is great for Angular projects, it was very easy to use and it's a shame it doesn't work on phone.

I would fix this myself, but I'm not very good with JavaScript and this seems to require some additional logic: https://developers.google.com/web/fundamentals/primers/service-workers/registration