I've got a Progressive web app and packaged inside an android WebView. I'd like it to work offline. How do I access the cache/service worker and make it happen?
1 Answer
This is simple - use the ServiceWorkerController instance. Although it only works on Android N and up so make sure to tell your users to install your site as a PWA for these users.
https://developer.android.com/reference/android/webkit/ServiceWorkerController
2 Comments
Filip
Thanks for the link, but how do I use the instance specifically? I'm not really sure about that, the docs don't really tell me how.
devwk
stackoverflow.com/questions/45773104/… shows an example and explains how it works so that should work fine for you.