Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there any way to extend service worker? #47

Open
BobidaHombre opened this issue May 31, 2024 · 1 comment
Open

Is there any way to extend service worker? #47

BobidaHombre opened this issue May 31, 2024 · 1 comment

Comments

@BobidaHombre
Copy link

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
Copy link
Member

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants