简体   繁体   中英

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM