Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Importance of manifest.json for firebase web push

I am working on implementation of web push notifications using FCM library. I have created a service worker file in the root folder of the domain and another js file in the Project to show web push notifications.

The web push notifications are working fine and showing up in the browser. According to the documentation a manifest.json with a gcm sender id is required in the root folder. I have not created this web app manifest file, but still I can see the notifications in the Chrome browser.

Could anyone clarify why exactly is manifest.json required.

like image 292
Webdev Avatar asked Nov 07 '22 19:11

Webdev


1 Answers

For Chrome to route FCM messages to the correct service worker, it needs to know the Sender ID

Have a look at these pages:

https://developers.google.com/web/fundamentals/push-notifications/ https://developers.google.com/web/ilt/pwa/introduction-to-push-notifications

like image 60
Alexandru R Avatar answered Nov 14 '22 20:11

Alexandru R