3

I have a Next.js application and I use next-pwa for the Offline Mode. Now I want to add push notification (OneSignal solution), I've seen many articles/tutorials, and they all require to create/update the service worker.

So my question is: How can I do that since the service worker is generated by next-pwa and it doesn't seem to be editable since it's minified.

juliomalves
  • 42,130
  • 20
  • 150
  • 146
adamine
  • 105
  • 2
  • 8

1 Answers1

7

You can have a look at the examples in next-pwa GitHub repository.

There is an example to add custom worker: https://github.com/shadowwalker/next-pwa/tree/master/examples/custom-worker

And also another example regarding web push: https://github.com/shadowwalker/next-pwa/tree/master/examples/web-push

Hope these few links help you!