Search code examples
iosfileapp-storeiclouddata-storage

Should I follow iOS Data Storage Guidelines?


My iOS app is intended to be compatible with iOS 5.0 and above, and it has iCloud capabilities turned off in it's target settings, I'm not integrating with iCloud. My app stores an sqlite file and some image files into Documents folder. The sqlite file is not downloadable, but images are.

I've read some posts from people saying that their app's submission was rejected because they don't met the iOS Data Storage Guidelines, but I'm not sure if that is only required if your app has iCloud capabilities enabled, is it? Should I set the NSURLIsExcludedFromBackupKey for my files anyway?

Thanks in advance

EDIT

I've read this here:

It is not possible to exclude data from backups on iOS 5.0. If your app must support iOS 5.0, then you will need to store your app data in Caches to avoid that data being backed up. iOS will delete your files from the Caches directory when necessary, so your app will need to degrade gracefully if it's data files are deleted.

But I need the sqlite file to be in Documents to insert data... how should I handle this?


Solution

  • It has nothing at all to do with whether your app uses iCloud or not. It has to do with the user performing backups to iCloud which is beyond the control of your app.

    If all of the data in your app that is stored in the app sandbox is data that is created and stored by the user through the use of the app then Apple will have no problem with the data being backed up.

    They have issue with replaceable files being backed up needlessly. If the database file is read-only and could be obtained from a server or the app bundle then don't let it be backed up. But if it starts out mostly empty and then gets data added as the user adds data through the app then it should be backed up. Same for the images.