Can a progressive web app (PWA) run a background service on a mobile device to get data from hardware (accelerometer, gps…)?

The modern method of running code “in the background” is by using a service worker, either via its push event handler (triggered via an incoming push message), or via its sync event handler (triggered by an automatic replay of a task that previously failed). It’s not currently possible to access the type of hardware sensors … Read more

Which icon sizes are required for progressive web apps (PWA) as of Q1 2018?

If you want to include a complete set of icons for Android: icon-72×72 icon-96×96 icon-128×128 icon-144×144 icon-152×152 icon-192×192 icon-384×384 icon-512×512 There is some helpful tools like https://www.simicart.com/manifest-generator.html/, to create icons. For iOS, you will need: icon-120×120 icon-180×180 With square background (can’t be transparent background). A good repository for references at https://github.com/gokulkrishh/awesome-meta-and-manifest

PWA – beforeinstallprompt not called

Try this : <script> let deferredPrompt; window.addEventListener(‘beforeinstallprompt’, function(event) { // Prevent Chrome 67 and earlier from automatically showing the prompt e.preventDefault(); // Stash the event so it can be triggered later. deferredPrompt = e; }); // Installation must be done by a user gesture! Here, the button click btnAdd.addEventListener(‘click’, (e) => { // hide our … Read more

Service worker JavaScript update frequency (every 24 hours?)

Note: As of Firefox 57, and Chrome 68, as well as the versions of Safari and Edge that support service workers, the default behavior has changed to account for the updated service worker specification. In those browsers, HTTP cache directives will, by default, be ignored when checking the service worker script for updates. The description … Read more