Sjeiti / project-invoice

This invoicing application stores all your data on your local machine. Your data is not shared between different browsers or computers.
https://projectinvoice.nl/
GNU General Public License v3.0
1 stars 1 forks source link

implement notifications api #105

Open Sjeiti opened 6 years ago

Sjeiti commented 6 years ago

see old angular branch named 'serviceWorkerNotifications'

Sjeiti commented 6 years ago

Tried implementing some older tests but got stuck (did a quick proof of concept a few months ago).

The permission request and service worker registration succeed. But navigator.serviceWorker.controller is null (sw has skipWaiting on install implemented). There is a valid registration but calling postMessage on registration.active throws a warning about a port being neutered (which is probably to do with navigator.serviceWorker.controller being null). The latter workaround does get picked up by the sw (and three seconds later the client), yet it does not show an actual push notification (just a console.log).

While isolating the issue found that current Chrome seems to fail. Examples on this page work in Canary, Firefox and Android, but not on my Chrome 65.0.3325.181 (Official Build) (64-bit).

Let's wait a bit and try again later.