Progressive web app feature - Vanuatu-National-Statistics-Office/vnso-nsdp-platform GitHub Wiki
PWA overview
The platform is coded to behave as a progressive web app with offline functionality. This means 2 things, for certain supported browsers and operating systems:
- Offline usage: The content of the platform will be downloaded and saved for offline usage
- App installation: The platform can be installed -- or "added to home screen" -- so that it can be launched as an app.
Browser and device support
The support provided by each browser and operating system varies, and is still evolving. In addition, the way in which the offline usage and app installation behave will vary. Here are some quirks to be aware of:
- At the time of this writing, Apple devices impose a limit on the amount of content that can be cached for offline usage. This may be less than the full content of the NSDP platform.
- Some browsers (such as Chrome) may present the user with an alert that the platform can be installed, when visited for the first time.
- Other browsers may rely on the user to install the platform voluntarily. (This is the reason for the "Install the app" card on the NSDP homepage.)
- The exact method of installation also varies across browsers/devices. (This is the reason for the detailed instructions for the user).
Maintenance
There is no maintenance needed for this PWA functionality. However there are a few configuration options in the site configuration. At the time of this writing, they are:
progressive_web_app:
enabled: true
name: Indicators of the National Sustainable Development Plan
short_name: NSDP Indicators
precaching: true
Some notes about the options above:
enabled
: This needs to be true in order for the PWA functionality to be turned on.name
: This is used as the full name of the app, when installed.short_name
: This is used as the short name of the app, when installed.precaching
: This supports the offline usage by caching content when the site is first loaded. If this is false, content is only cached as the user visits it.
Open SDG support
At the time of this writing, this functionality is not in Open SDG yet. However with feedback from this implementation we may be able to get it added. In the meantime we are using a fork of Open SDG in order to achieve this.
App stores
It is theoretically possible to get PWAs added to app stores, however this is dependent on approval from those app stores. Some of the app stores are more strict than others about which apps they approve. At the time of this writing, the Apple app store is known to be reluctant to approve PWAs, while the Google Play store and the Microsoft Store are more lenient.
I would recommend not applying to any app stores until the platform is fully operational and populated with data. When ready, here is documentation of the next steps:
- Play Store: https://docs.pwabuilder.com/#/builder/android
- Microsoft Store: https://docs.pwabuilder.com/#/builder/windows
- App Store: https://docs.pwabuilder.com/#/builder/app-store