Here is a simple implementation of Firebase Cloud Messaging with React-PWA.
Clone the repo: [email protected]:yash-thakur/pwa-fcm.git && cd pwa-fcm
Make the following necessary changes:
- Update GCM-Sender ID in
public/manifest.json
. - Update the Firebase Config in
public/firebase-messaging-sw.js
. - Update the Firebase Config in
fcm-config.js
.
Run using npm i && npm start
Open the browser (http://localhost:3003
) with Developer Tools and note the Current Token
from the console.
Go to the Firebase Notification Tester and open Notification Composer.
Paste the token and send the Test Notification