javascript – Capacitor IOS/Android: How to load images from app/play store after the app was already downloaded


I heard there is:

  • On-Demand Resources (iOS-Specific)
  • Split APKs (Android-Specific)

Which allow to download content after the initial app download, to reduce the initial bundle size. I have 1000 HQ images inside my Ionic Capacitor mobile app, the bundle size would explode. How can I host them on the respective app & play store and have the app download the resources aftwards?

I think the two mentioned methods above could do that. I think they are free to use as much as one wants, which is why I prefer them over hosting my own backend, since hosting 1000 HQ images to multiple users could make hosting the backend very expensive I think, since I think the app could reach more than 100,000 users at some point. Even when caching the images after a download, I think the single download alone could become very expensive with many users.

Is there a plugin for capacitor for those two? Afaik the two listed services are pretty similar, so a plugin could likely target both in an abstract platform-agnostic way.

If such a plugin does not exist:
what are some other ways I can use those services in my ionic capacitor app? Can I download them from within the WebView maybe? Or is there some workaround that I can use?

I would also consider writing my own plugin, but it is hard for me to estimate how much work this would be, especially to make the interface as abstract as possible to provide a pretty generic interface for both platforms. Maybe someone with experience could tell how hard of a job that would be.

Sources:

https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/On_Demand_Resources_Guide/

https://developer.android.com/build/configure-apk-splits

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img