A couple of weeks in the past, I upgraded my Ionic/Angular app from Capacitor 5 to Capacitor 6 and adopted Google’s new Play Retailer privateness insurance policies.
Within the earlier model of the app (final up to date in June 2023), we used these Android permissions:
- READ_MEDIA_IMAGES.
- READ_MEDIA_VIDEO.
- READ_EXTERNAL_STORAGE.
- WRITE_EXTERNAL_STORAGE.
Within the new model, I eliminated all of these permissions and changed them with the Photograph Picker API as required by Google.
For older Android variations, I ensured compatibility by integrating the photograph picker by way of the manifest (Google providers).
App context:
-
We use @ionic/storage to retailer a big appData object domestically.
-
This enables the app to work offline, displaying cached content material when there’s no web.
-
When linked, the app syncs with the backend and updates the native knowledge.
-
Customers have to be registered in our backend system and logged in to make use of the app usually.
-
Consumer tokens additionally saved within the native appData.
The issue after the replace:
After publishing the brand new model (with Capacitor 6 + permission modifications), many customers (largely Android) reported this difficulty:
-
The app opens wonderful, the UI masses, and all buttons work.
-
Nonetheless, the app behaves as if the consumer is logged out, regardless that they’re logged in.
-
The app fails to fetch new knowledge, doesn’t sync with the backend, and solely exhibits outdated or no content material.
-
On iOS, just a few customers had comparable issues (And few customers simply get white display screen), however far fewer than on Android.
Uninstalling and reinstalling the app fixes the difficulty.
It looks as if the app is failing to load legitimate session/token knowledge from native storage, regardless that the login was accomplished earlier than.
What I believe:
-
Some customers might have corrupted or inaccessible native storage after the replace.
-
Probably brought on by modifications in Capacitor 6’s native storage dealing with.
-
Or perhaps the removing of previous storage-related permissions broke one thing on sure gadgets.
What I’ve already accomplished:
My questions:
-
What may trigger @ionic/storage to fail or return stale/undefined knowledge after upgrading to Capacitor 6?
-
Might eradicating permissions like READ_MEDIA_* and switching to Photograph Picker not directly have an effect on storage accessibility or trigger corruption?
-
Has anybody else skilled comparable points with persistent storage after latest Capacitor upgrades?
Any assist or route can be vastly appreciated!