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

How to Remove Chrome Logo from PWA App Home Screen Link (Android O Preview)

Above answer is not accurate except for the part that Chrome had the issue of adding Chrome badge to App icon, which is changed in the following updates. Before getting into whats wrong, here is how web apps are added to home screen. 1) As a simple shortcut(like a bookmark), when the users web browser … Read more

Can I have multiple service workers both intercept the same fetch request?

No, you can not. Only one service worker per scope is allowed to be registered so the latest kick the previous one out unless the scope is more specific, in this case, the request is attended by the most specific only. Nevertheless, you can attach multiple fetch handlers and they all will process the request … Read more

How do I set the start_url of a manifest.json to be the root of the site?

If you are running in the root of a site, for instance https://example.com/manifest.json or https://test.example.com/manifest.json you can use “start_url”: “https://stackoverflow.com/”. However, this will also map https://example.com/test/manifest.json to https://example.com/, which fails because it’s in a folder outside the scope of the manifest. Instead, if you are using a sub-directory you need to set both a scope … Read more

Access localStorage from service worker

You cannot access localStorage (and also sessionStorage) from a webworker process, they result will be undefined, this is for security reasons. You need to use postMessage() back to the Worker’s originating code, and have that code store the data in localStorage. You should use localStorage.setItem() and localStorage.getItem() to save and get data from local storage. … 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

Difference between a progressive web app and a hybrid mobile app

A hybrid mobile app usually refers to an application built using a combination of web and native technology that is distributed via a native app store. These apps go through Apple, Google, Microsoft, etc’s app store review process. A Progressive Web App is an application built using web technology that runs in the browser and … Read more

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

Vue PWA not getting new content after refresh

As I figured out, this question is really only related to beginners in PWA, which don’t know that you can (and need) to configure PWA for achieving this. If you feel addressed now (and using VueJS) remember: To automatically download the new content, you need to configure PWA. In my case (VueJS) this is done … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)