I have an ionic-3 app for iOS and Android that requires large assets, in total about 300 MB of mostly images. The app needs to work without cellular or wifi connection, which is why I can’t download the assets on demand.
Unfortunately, Google limits the size of the APK file to 100 MB. Is there a standard way to deal with this situation?
I’ve found the https://github.com/agamemnus/cordova-plugin-xapkreader. Unfortunately, this would only work for Android. Before inventing some kind of iOS/Android switch, I was wondering if somebody knew a better way. Thanks!
For others facing the same problem: I will try this using ionic’s live-update mechanism.
The assets will be compiled in different compression rates: A low preset is about 90 MB, and a high preset is my original 300 MB.
The high preset is used in the iOS app that will be deployed to the Apple-App-Store.
The low preset is used in the android app that will be deployed to the Google-Play-Store, meeting Google’s 100-MB limit.
The high preset will be pushed to ionic: git push ionic master. This way, after downloading the app from the Google-Play-Store (100 MB), the ionic-live-update mechanism will fetch the larger assets (300 MB) from ionic.
Hei,
I am in the same situation, where I have 300 MB static files which is required for my application. The only way that I can think of is download files using the ionic file plugin during the initial loading (first time) but in that case, the files which we are downloading(images, video) will be publically available throughout the phone right? Can you please advise on this or if you have another idea pls do let me know.
I guess this depends on exactly what you mean by “publicly”, but if “anybody with physical access to the device in an unlocked state” qualifies, then what you have said is true not just for any specific case, but for any solution to this problem. Anything the app can access, so can the device owner.
What I meant is, the assets downloaded will be available in the data folder (if we are using “dataDirectory” ) which can be accessed via any file explorer. In obb (native apk extension approach), assets cannot be accessed in the above manner,
Is there any alternative approach like obb(native apk extension approach) in ionic ?
Hi!
I think you may process the images using an Api from Tinypng for example to become more tight and use lazy loading inside the App to avoid to crash it. Also use some cache to offline images. But please, put 300 MB inside an App seems me not normal and can be not useful to the users.
The UX will be down.