Can we poll for notification from service worker -
when implementing push notifications using service worker, can directly push notifications endpoint. in website notifications fetched outside api. there way service worker poll notifications can identify if new notification present?
if web application open, can show notifications checking criteria (polling api, etc.) , using notifications api.
this not require service worker. using service worker + push events trigger notifications means notifications appear if web application closed, , more efficient rely on listening push events vs. repeatedly polling api.
you theoretically use combination of polling , explicitly calling notifications api when web app open in addition registering service worker listens push events. if you're putting in effort support service worker use case, relying on service worker of notifications might cleaner.
one difference between 2 approaches using notifications api while web application supported in more browsers (as of august 2017) service worker-based push notifications.
Comments
Post a Comment