Web application for providing audio content to users. It's not officially l=
I started using the Push API so that when a user finds audio content they l=
ike, they can subscribe to that content provider and get notifications when=
that provider uploads new content.
It is working fantastically with FireFox 49.
The subscription is activated by a button inside a div. Initial state of bu=
tton is disabled.
on pageload, JS checks for "serviceWorker" in navigator and then checks for=
"showNotification" in ServiceWorkerRegistration.prototype and then checks =
for Notification.permission !=3D=3D "denied" and finally checks for "PushMa=
nager" in window
If any of those tests fail the button remains disabled and the div has its =
display set to hidden.
So the button to subscribe should only be available on platforms that actua=
lly support the feature.
In FireFox everything is working both on desktop browser and on FireFox for=
I don't have access to Chrome for Desktop, Google doesn't support Chrome on=
CentOS 7 which is my desktop.
But Chrome on Android, the subscribe button is shown and activated indicati=
ng Chrome on Andoid supports what is needed - but it doesn't work.
From looking around the web, I got the impression from several sources that=
a manifest.json is required for Push API to work for Chrome (which is odd,=
the W3C specification says nothing about needing that) so I created and po=
pulated a manifest.json and made the link tag pointing to it.
Chrome for Android still won't allow push subscription.
Does anybody know what is going on? What chrome wants?
er are JSLint compliant (other than using in instead of hasOwnProperty but =
that's stylistic, not an actual error), the service worker only listens for=
the push event.
But the endpoint isn't even being created on chrome for android for me to t=
est the push on that platform.
There must be something chrome is looking for that isn't in the specificati=
on, and I can not figure out what it is.
Chrome's documentation on service workers and push API is useless to me as =
it assumes the chrome developer tools are being used, so I followed the moz=
illa documentation. But something extra (beyond a manifest.json) is clearly=
needed for chrome and I can't figure out what it is.
Thank you for any assistance.