vite-pwa / astro

Zero-config PWA Integration for Astro
https://vite-pwa-org.netlify.app/frameworks/astro
MIT License
170 stars 5 forks source link

Is there any way to extend service worker? #47

Open BobidaHombre opened 4 weeks ago

BobidaHombre commented 4 weeks ago

Hey. I am trying to add PWA to my Astro app, but I encountered problem that my service worker to handle push notificiations is overwritten by service worker for PWA. Is there any way to extends PWA service worker? Did You encountered such problem? How did You handled it?

userquin commented 4 weeks ago

Just use a custom sw including both pwa stuff and push notifications logic.

Check any example in the pwa repo for a custom sw (injectManifest streagy) for pwa stuff. You can also check this custom sw for push notifocation, push notifications clicks and pwa stuff https://github.com/elk-zone/elk/tree/main/service-worker (also with web share tsrget api)