i just wonder how the "FCM" realy works on the web. does it use websocket ,or it's a built in feature whit in browsers (chrome,firefox ,...)
1 Answers
FCM (Firebase Cloud Messaging) uses HTTP and XMPP Server Protocol serving JSON and Plain Text both.
FCM Server Protocols Currently FCM provides these raw server protocols:
- FCM HTTP v1 API
- Legacy HTTP protocol
- Legacy XMPP Protocol
Your app server can use these protocols separately or in tandem. Because it is the most up-to-date and most flexible for sending messages to multiple platforms, the FCM HTTP v1 API is recommended wherever feasible. If your requirements include upstream messaging from devices to the server, you'll need to implement the XMPP protocol.
Please visit About Firebase Cloud Messaging Server | Firebase for more details,https://firebase.google.com/docs/cloud-messaging/server#choose. Hope it helps.
How exactly are web push notifications delivered to a user's device?
There are three actors involved with delivering a web push notification, along with a fourth, optional, component for advanced functionality.
Web Push Notification Service: Each browser, including Chrome, Safari and Firefox have their own notification delivery service. Chrome uses Google Cloud Messaging (and now Firebase Cloud Messaging ), Safari uses Apple Push Notification Service (APNS) and Firefox uses MDN servers.
Service Worker Registration: Developer must register the service worker on the browser. This is only for Chrome and Firefox. Safari while has added support for service-workers, Safari notifications are delivered using a different mechanism.
User’s Subscription ID: Subscriber ID is generated when a user opts in to receive notifications from a specific website.
Additionally an SDK (OS client library Software Development Kit) can be added to a web app for extended segmentation and analytics capabilities.

- 565,676
- 79
- 828
- 807

- 121
- 7
-
thank you for your answer , but i already read this from the documentation and it didn't answer my question,my question is about recipient of the messages in a web client side – ayoub_007 Jun 27 '19 at 21:22
-
did you mean how exactly browsers receives notification ?? – MahanteshGowda Patil Jun 27 '19 at 21:38
-
Edited answer please have a look – MahanteshGowda Patil Jun 27 '19 at 21:45
-
1thanks again, that was really helpful,so i get from your answer that every browsers come with built in push service , for me as a low level developer ,mean that there is a background socket(TCP/ip connection) serve that purpose. – ayoub_007 Jun 27 '19 at 22:11