Hi Pato!! Thank you for tutorial its really helpful. There was one thing I was wondering , how do we combine the sw.js you created for the Add to Home Screen PWA to the firebase push notifications one. Currently, both my service workers are overwriting each other so only one of them works.
Just to clarify, I am registering both service workers in main.js, one after each other.
You can only have one service worker (besides the firebase-messaging-sw.js). In this code I have that functionality combined together github.com/devpato/creating-a-pwa-...
Thank you for the quick response! So just to confirm, with this, the sw.js is able to function properly and firebase is still able to talk to the background app without us registering it on our side?
you will have the firebase-messaging-sw.js and the sw.js file like I did on the repo. Make sure the firebase-messaging-sw.js has that name. That's how firebase code will look for that file
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi Pato!! Thank you for tutorial its really helpful. There was one thing I was wondering , how do we combine the
sw.jsyou created for theAdd to Home ScreenPWA to the firebase push notifications one. Currently, both my service workers are overwriting each other so only one of them works.Just to clarify, I am registering both service workers in main.js, one after each other.
You can only have one service worker (besides the firebase-messaging-sw.js). In this code I have that functionality combined together github.com/devpato/creating-a-pwa-...
Thank you for the quick response! So just to confirm, with this, the
sw.jsis able to function properly and firebase is still able to talk to the background app without us registering it on our side?you will have the firebase-messaging-sw.js and the sw.js file like I did on the repo. Make sure the firebase-messaging-sw.js has that name. That's how firebase code will look for that file