My app has a few in-app purchases that downloads video content to the /Documents folder. I recently submitted an update to the app and was rejected because I did not flag the video files to not be backed up to iCloud. I succesfully implemented the flagging but I am still confused by this statement in Apple's documentation:
Important The new "do not back up" attribute will only be used by iOS 5.0.1 or later. On iOS 5.0 and earlier, applications will need to store their data in /Library/Caches to avoid having it backed up. Since this attribute is ignored on older systems, you will need to insure your app complies with the iOS Data Storage Guidelines on all versions of iOS that your application supports.
My app supports iOS 3.2 and later, so do I need to account for different versions of iOS in my code or is implementing the do not backup flag enough to pass for App Store approval? I really don't want to drop support for versions earlier than 5.0.1.
Please help!
The correct behavior for your app is to place the files in Library/Caches on OSes prior to 5.0.1, and place it into Documents with the "do not backup" flag in 5.0.1 or later. the downside of using Library/Caches is the files will be wiped when the user upgrades the app (so they'd better be able to re-download them). But the upside is you won't be bloating their backups with files that shouldn't be backed up.
Note that on 5.0.1 or later if you detect that the files aren't there, you should check their pre-5.0.1 location before downloading them, in case the user just upgraded their OS.
The concern area is the iOS 5.0, which supports iCloud, but does not recognizes “do not backup” attribute. In this case, all the data of the app inside documents directory is likely to get backed up to iCloud. For the iOS versions below 5.x:
Hence the data can be kept in the documents directory, with "do not back up" flag appropiately added to the contents (files/folders), for all the versions. The problem is for the version 5.0 only.