Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cache a Progressive Web App inside a WebView

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?

like image 417
Filip Avatar asked Apr 16 '26 21:04

Filip


1 Answers

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

like image 151
devwk Avatar answered Apr 18 '26 11:04

devwk



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!