bubblewrap icon indicating copy to clipboard operation
bubblewrap copied to clipboard

Fully load the PWA on initial install of the app and keep it that way, so users can rely on offline behavior

Open dumbmatter opened this issue 4 years ago • 2 comments

Is your feature request related to a problem? Please describe.

I made an app using Bubblewrap for a video game I wrote. The game works 100% offline. But I just got a one star review saying "whaaat you need internet connection for this cheap trash game". This is an unfortunate situation that (AFAIK) has no good solution currently. What can happen now is:

User installs a TWA from the Play Store, not knowing it is a TWA. User does not open the app until they are somewhere without Internet access. User observes the app does not run without Internet access, even though for the user there is no apparent reason why that should be true.

Similar problem happens if browser data somehow gets cleared... the user cannot really rely on the TWA being accessible offline, there is always a chance it won't be, even if it was previously.

Describe the solution you'd like

Maybe the service worker could be started during installation so it could download all the data it needs to run the app offline? And ideally, as long as the app was installed, this data would not be allowed to be cleared by the browser (I can imagine this point is probably even harder to deal with than the 1st).

Describe alternatives you've considered

Alternative would be the old fashioned way - bundle your entire client side code as an app using Cordova or something. Then it does reliably work offline. But TWA/bubblewrap is so much easier...

dumbmatter avatar Sep 26 '21 21:09 dumbmatter

Ideally, we would be able to ship resources with the APK to allow the application to start, even if the initial load happens while offline. Unfortunately, this is something that needs support from the browser to be implemented and can't be solved by changing Bubblewrap. There's an issue open in the Chromium bugtracker for this: https://crbug.com/816798. I'd recommend starring the issue and sharing your use-case on the thread.

andreban avatar Sep 27 '21 11:09 andreban

This doesn't solve the issue, however it should be possible to show at least a You are offline message.

How-to:

piotr-cz avatar Nov 24 '21 14:11 piotr-cz