Need Help Placing Service-worker.js' in Root Directory for Shopify Web Push Notifications

Need Help Placing Service-worker.js' in Root Directory for Shopify Web Push Notifications

etersongray
Visitor
3 0 0

I'm facing a problem while trying to implement web push notifications for my Shopify store using the Firebase Cloud Messaging Service. In order to enable this feature, I need to upload the 'Service-worker.js' file to the root directory. However, I'm encountering difficulties in placing the file in the desired location. Has anyone successfully integrated web push notifications on Shopify and managed to upload the 'Service-worker.js' file to the root directory? Any insights or guidance on overcoming this issue would be greatly appreciated! 

 

Replies 2 (2)

etersongray
Visitor
3 0 0

I am not getting any answer. kindly do assist me. 

SonuSantosh
Shopify Partner
4 1 0

hey Etersongray,
you can use app proxy or can use shopify CDN directly for giving a path for your service worker to the online store, after that you need to register that service worker to root path using navigator in JS script , for reference check this .
hope this will help you..