2

In the context of pushing notifications to web-browsers, the PUSH SERVICE acts as interface between the SERVICE WORKER and APPLICATION SERVER.

My current understanding is that

  • Google FCM is the Push Service for Google Chrome & FireFox browsers
  • APNS (Apple Push Notification Service) is the Push Service for Safari browser

Here, is it technically possible to substitute the ‘push service(s)’ (– i.e., Google FCM for Google Chrome & FireFox browsers and APNS for Safari) with a generic custom service worker which could potentially address all the popular browsers that support Service Worker and Push API?

In other words, whether developers have control over which push service to be used for a browser (or) develop a custom push service for all the browsers?

  • Firefox push service is Mozilla autopush, not FCM. Each browser has its own push service, and as a web developer you can't change that. For example Edge uses Windows Push Notification Services. – collimarco Apr 08 '22 at 09:36

1 Answers1

2

You're mostly correct: the Push Service acts as an interface between a service worker and application server, with the addition that the service worker (or potentially the web app) sends subscription info to the application server outside the Push Service, so the application server knows the endpoint and how to properly encrypt any notification content.

Google uses GCM/FCM for Chrome, and Mozilla uses its own Push Service in Firefox for desktop, while using GCM/FCM and/or its own service for Android; see the "What information does Firefox use to provide Web Push?" section here.

At the time of writing this, Chrome, Firefox and Edge support the Push API, so there's no need to handle each seperately (WebKit doesn't support it).

Short answer: developers don't have a choice in which Push Service the client uses, but the adoption of the Push API standardizes the service worker and web push across major browsers (excluding WebKit).

NickT
  • 116
  • 1
  • 8