Search code examples
iosdistributionupdatesenterprise

IOS Enterprise Distribution update keep user data?


I'm making an iPad app which will be distributed from my own web server using Enterprise Distribution Program. The app itself checks for a newer version on the server and calls itms-services in IOS to update itself. This works perfect.

The app bundle contains a directory with resources like images and movies.

Apple claims that updates will keep the users data if the bundle-identifier is the same.

From: http://help.apple.com/iosdeployment-apps/mac/1.1/#app43ad802c

If you want users to keep the app’s data stored on their device, make sure the new version uses the same bundle-identifier as the one it’s replacing, and tell users not to delete their old version before installing the new one. The new version will replace the old one and keep data stored on the device, if the bundle-identifiers match.

When running the app from Xcode directly to my connected iPad, I can remove the folder with my resources, run the app again, and the folder remains in the bundle on my iPad.

This behavior is what i look for. I'm planning on adding more folders with new resources with new updates. Since the resources are quite heavy, I don't want users to have to download bigger and bigger archives. I want to add just the new stuff.

The problem arises when I make a new archive without the folder and update the app from my web server as users would. Then the folder seems to be deleted.

Any experience with this?


Solution

  • The bundle that you install is always overwritten by the new bundle that you install. The user data referred to in the documentation is the data stored in the Documents and Library folders of the file system. If you wish to be sure that the old bundle files will always be available, you can copy them from the bundle to the Library/Caches folder of the application. One thing worth mentioning is that the way to ensure that the ad hoc installation overwrites the current bundle is to make sure that you change the bundle version.

    hope this helped :)