How to run Service Worker inside the bubble.io?

So how do either of these (OneSignal or Superview) give you what you need to build a PWA and allow the user to copy it onto their home screen on iOS or Android?

The service worker file is normally created from the webstie root folder commandline and placed in the root folder of the website. However, among other things that requires running

npm install --global sw-precache

Which creates a cache of all the website resources so the PWA can run by itself and the service worker has the necessary resources.

Part of this seems to be resolved in another forum discussion as it relates to putting scripts into the settings --> Seo /Metadata

How do you get a Service worker working on PWAs

However, it still does not answer how to allow a user to copy a link onto their homescreen? Not sure how onesignal or superview accomplish that either… and they can be expensive…

2 Likes