PWA Questions
Hello UNA Team,
Many questions about the PWA in this discussion board remain unanswered and the lack of documentation makes it even worse. We are just walking blind.
An official answer from the UNA Team on the following questions shall be highly appreciated @Alex T⚜️ @LeonidS @Anton L :
1. Which URLs should be included in the PWA Service Worker > URLs to cache on install (each in new line)?
2. How should those URLs be entered? As absolute urls (e.g https://www.example.com/dashboard) or relative urls/paths (e.g. /dashboard)?
3 . Which pages should be included in the Offline page field? And how should they be entered? e.g.: dashboard, subscriptions.php, credits-history-common (comma-separated)?
Thanks
-
-
·
Alex T⚜️
- ·
1 - some common js/css files should be definitely included, then you can specify some other pages with their js and css files, which should work in offline mode, also you need to cache offline page URL with all it's css/js files.
2 - it's better to specify them as relative URLs, for example for `https://ci.una.io/test/dashboard` page you can specify it as `dashboard`, full URL is also fine.
3 - offline page is a page which is displayed for user when your site is offline, and the URL isn't included in 'URLs to cache on install' field.
-
·
Alex T⚜️
-
- · Cem
- ·
I was able to setup a PWA by editing:
https://yourdomain.com/plugins_public/onesignal/manifest.json.php
also inject to every page:
<link rel="manifest" href="https://yourdomain.com/plugins_public/onesignal/manifest.json.php?bx_name=...">With this setup I could have multiple PWA's for site wide, for specific groups etc.
-
Ok when I looked into the OneSignal folder I found these two files and am wondering which I should use:
OneSignalSDKUpdaterWorker.js.php
OneSignalSDKWorker.js.php
I am assuming it would be the second one, since the first is for updating apparently.
-
these are onesignal files not directly related to your PWA.
correct files to edit or create are:
https://yourdomain.com/plugins_public/onesignal/manifest.json.php
also inject to every page:
and for service worker you may create a sw.js file and put it to the root web folder.