This example demonstrates how to handle browser push notifications using vanilla HTML & JavaScript via Web Push API. WebPush API sends messages from the server (backend) to the client (browser/mobile phone). The API uses HTTP2 protocol which requires HTTPS connection (unless you're in localhost) The server sends messages to the client's browser via Firebase Cloud Messaging API (or FCM for short).
- You need to obtain the public VAPID key to be able to connect to the server. Look up generate-VAPID-key.md file.
- Make sure Backend server uses the same VAPID keys.