We have at least two Android applications that use the webview component with persistent offline data in the form of IndexedDB, LocalStorage, and Cookies. They appear to lose all of this data with the upgrade from Android 9 to Android 10 on Pixel XL (and at least one other device). This has not happened with these apps on other device upgrades over the last 5 years on any device that we know of.
This has the potential of data loss if users do push WebView data changes to the server before performing the upgrade.
We're trying to figure out if this is:
A bug in the upgrade process?
Intentionally done for some reason (and is it documented)?
Some change we are expected to include in the app to survive the Android 10 upgrade without this data loss?
Other Notes:
We confirmed that if we reload the data it operates normally but, as mentioned, users can still lose data with the upgrade
We tried restarting the device again
We created a debug version to inspect and the data
There were some changes in a way that WebView works. It is no longer provided by Google Chrome, WebView is now a separate app. Reason behind this is EU restrictions.
You can find more information here.
Related
I'm currently building an Ionic app which will be getting very frequent updates. If possible, I want to avoid sending users to the app/play store each time I push a change (which will probably happen at least twice per month).
I use the coinmarketcap mobile app a lot which seems to be built on some sort of browser rendering engine (although I don't know which one). Often, when I open this app, I get a small changelog informing me that there was an update, and can immediately start using those new features, without having to manually download the app.
Is it possible to build such an automatic update system with Ionic (React) 6 (w/o Appflow)?
Scenario
I have an existing native android app in which I want to add some new features. These features have already been implemented as a PWA because some users needed to use them directly from the web.
I want to be able to open the PWA with an Android WebView (as if it was part of my native application) and install it 'locally'. With 'locally' I mean that the PWA should not be visible as an app in the phone, it would just be part of my existing native app. In a way, what I'm trying to achieve is a king of "plugin" system, where I could have extra features that the user can install to the native app.
Where am I stuck?
Opening the PWA with a WebView is fairly straight forward. The part that I am unable to do is installing the PWA. Maybe TWA could solve this issue, but I am not sure it is meant for that.
Moreover, ideally I would like to keep everything in a Fragment since I would like to have the toolbar and others created by the native app (that is why I've leaned more towards using WebView instead of TWA).
EDIT---------------
After messing around I was able to understand that it actually gets installed with WebView. Since I haven't been able to find any information about how it works online I've been researching it on my own.
First of all ServiceWorkerController is only available from Android 7 (24). I haven't been able to test if with Android 6 this can work or not due to the fact that I don't have any phone with that version and I can't update the WebView apk of my emulators for some reason.
Then, I found out that the webpage crashed in my newer emulators because the WebView apk installed was too low and didn't support some newer features. So another thing to take into consideration the WebView version installed. This apk gets installed separately from the Android version (it's as if it was an app on your phone). The solution to this is to just use a real device, because the apk is usually always up to date.
As you can see in the following picture the PWA gets installed inside the app folder and it also keeps all the info (databases, localstorage, sessionstorage, etc.) in there.
It is unclear how this data is handled (I created this question) but it appears to be at least in the following cases:
WebStorage.Instance.DeleteAllData()
App uninstalled
App Data Cleared
Clearing the Cache of the app doesn't delete the persistent data.
So now I would say that the question would be:
From which Android Version does the Service Worker install? Just from the Android version that has support for the webview apk version that supports Service Workers?
Does it depend at all on ServiceWorkerController? Or is it just a utility class to have more control over what happens?
We have a mobile app on iOS, Android, and UWP. Each release, we use the platform specific way to host a beta version. Then we install the production release of the app from the app store, add some basic data, and then install the beta version over the top to test version to version upgrades. However, this is not a sufficient test as the data is very simple vs testing a db upgrade for a user who has had the app for years with lots of data. It also doesn't cover v1.1 to v1.5, v1.2 to v1.5, etc tests. We can do those tests as well, but the loading of a good set of data is very time consuming.
What is a good way on each platform to load a very large simulated data set? As far as I can tell, I have no ability to replace the SQLite db on iOS or Android. How do people do this type of testing? Do you add the ability to pull the simulated data from your server and load it into the db? Other ideas?
There are not that many options to regression testing, you could try Appium to install/run multiple binaries and run your test scenarios to see if app behaviour is as expected.
checkout :
http://appium.io/docs/en/writing-running-appium/caps/
I am making a mobile app w/ a rails server for the backend. The basic premise is when a user signs in successfully, the server returns a unique token and their user_id. I store only those 2 things in local storage (window.localStorage not any library)
localStorage.setItem('user_id', data['id']);
localStorage.setItem('authToken', data['auth_token']);
I then use the token/ID to communicate with the server.
The problem, is recently in testing (app is already live w/ a couple dozen users), the token is occasionally not getting set or saving, and as a result, I get a 500 error. I say occasionally because sometimes it does work. I guess I'm mainly just confused. It was working fine w/ my initial pushes on the app, and works on ionic view. I don't know what has changed, as I have not changed any code.
From my standpoint and in my initial debugging, it looks like local storage is either unreliable, i need to use an angular/ionic option (not window.localStorage), find another way to store data like I have been (SQLite?), or it could be a permissions bug?
If anyone has experience something similar to this and found a viable solution, I would love to learn more about this and find a solution to fix it.
I think that before you choose another data store option, you must see your application in execution, try inspect the app in Google Chrome inspect or in Safari (case iOS), look at the localStorage proprieties using your app, I believe this is enough for you do fix your bug.
Inspect Chrome: https://developers.google.com/web/tools/chrome-devtools/remote-debugging/
Inspect Safari:
http://phonegap-tips.com/articles/debugging-ios-phonegap-apps-with-safaris-web-inspector.html
I am currently developing application using Cordova + Ionic for Android.
I use LocalStorage and PouchDB for data storing.
Recently I have discovered that Android 6.0+ has a feature to automatically restore apps once installed (even debug applications installed not from play store).
Every time I install app LocalStorage and PouchDB data gets restored which is not kind of behaviour I need.
I have read that developers have full control of that backup system, may tweak what gets backed up or if they want completely opt out of the system.
Question is how do I disable it in Cordova, is there some kind configuration switch, I did not find any.