Right now we are designing an app in Swift that fetches HTML applications from a server in form of zip files and then run it in the iOS app as an web view. Each zip files is of approx 4-5 mb in size. We have 30+ HTML applications in our app as of now. But we may reach to 150-200 apps soon enough. I would like to know the maximum amount of data that an iOS app can handle. If excess amount of data gets deleted, where will it go? Will it be stored in iCloud before the data gets deleted? Please help me. P.S. The HTML applications will be downloaded from the servers in form of zip files , it'll be extracted and then will be stored as a folder. When the user first installs the app in his system , he won't have any html applications installed. He'll have to fetch the apps one by one according to his requirements.
-
See the [question "Max size of an iOS application"](http://stackoverflow.com/questions/4753100/max-size-of-an-ios-application). – Jesper Nov 07 '14 at 12:40
-
the question points to the size of the binary file or the executable app file. I asked about the maximum amount of disk space an app can use after it gets installed in an Apple device. But thank you so much for your answer :) – SiltyDoubloon Nov 07 '14 at 12:45
-
Right, sorry, I meant to link to [the question "Size limit of an IOS Application & Data it stores on device"](http://stackoverflow.com/questions/16033112/size-limit-of-an-ios-application-data-it-stores-on-device) - but I saw that it was (wrongly?) closed as a duplicate and so I linked to the supposedly original question instead. You're right, they're two different things. – Jesper Nov 07 '14 at 12:47
-
Apparently, there is a limit of 2 GB. http://stackoverflow.com/a/13154217/2043580 – ZeMoon Nov 07 '14 at 12:52
-
@Jesper thank you so much :) that almost answered my question. I need one more favor. Is there any special case when iOS deletes user data data automatically to make space for other apps ? and if it does , can I have any prevention mechanism ? (e.g. uploading the data to iCloud before deleting). Thank you again :) – SiltyDoubloon Nov 07 '14 at 12:52
-
@KoushikKarmakar: I've been looking a bit and even the Apple documentation on the iOS file system is silent on the topic as far as I can tell. I seem to have a recollection that it was 2 GB but then raised to 8 GB in time for Newsstand and such apps, but I can't back that up with a verified source. – Jesper Nov 07 '14 at 13:19
2 Answers
Since you're saving the content to disk, the limitation is the disk size of the user's device. It also depends on where you're saving the data: If you save to the tmp directories, the data may get deleted, but if you're saving to the application's normal directory it will also be backed up to iCloud (assuming the user backs up).
I would advise against filling up the user's phone with hundreds of MB of data automatically, they will get very annoyed at you. So you will want to offer them a UI to actually select which content they want to keep and which should be removed.

- 20,112
- 2
- 29
- 42
-
Of course !! There will be an UI to only select and download the applications users really want to. :) They can also delete the apps they don't want to use anymore . Also I want to know if there is any mechanism that automatically deletes that when the disk is almost filled ? And if it is , can I deploy some prevention mechanism ? Thank You :) – SiltyDoubloon Nov 07 '14 at 12:55
-
No, there isn't such mechanism that automatically deletes files. Your app will receive CoreData errors when you try to save additional data that doesn't fit anymore. And the user will see pop-ups from various apps that there isn't any disk space left. – dirkgroten Nov 07 '14 at 13:11
No limit as far as I know.
But be aware that all files you download and store in the app have to be marked as "do not backup in iCloud" - otherwise Apple will reject your binary when you submit it to the store.
See Apple Documentation and Excluding files from iCloud Backup
My advice,
Don't download all the applications at once, instead provide user a UI from which he can able to select any application (only one at a time, because at any point he'll be able to run single app only, I guess), then download that particular application (also removed if any previous installed app found).
But wait, there's one more option, you can keep 3 apps at a time, and I believe they wouldn't cost you more than 20Mbs (as you said, 4-5Mbs / app). If so user may have feel of switching between (last used) three apps. If he want any other application then he can select any app, here you need to delete (a app from last three) and add newly downloaded app, this means at any point you'll have 3 apps in your directory.
Now the problem of preserving user information (for individual apps), here you can use any local db (or your server or any third party servers) to store (preserve) user information for particular app. At any point he'll delete the app (you should keep backup of it before deletion will be made).
Later, when he changed his mind, and download the app (previously deleted), then you can restore the information (which was preserved before).
Good luck! Don't wash your hands :)