[Resolved] Apple IOS issue - exclude data from backups using the "do not backup" attribute

I currently have 2 flash card apps that have been accepted to all stores except for Apple. They have rejected the app because i download data (flash card sets) to the system.DocumentsDirectory these sets are 5-10mb in size each. so all together if you get all the sets my app expands to about 70mb. on the first rejection, i have re-tooled my whole app to use the system.CachesDirectory but this has introduced a new problem… the cache directory deletes data files of mine far to often, my app is constantly having to go get them again from the internet. This sucks from a Quality aspect for my customers… I will just be burning up thier band width with constant downloading.

So i burned up a trouble ticket with Apple and their answer is … I CAN save files in the Documents directory as long as i set the “Do Not Backup” attribute flag on the files… How do i do this in Corona?

Short answer from apple on my issue:
[blockcode]
The general take away from those two documents is that your app is generally
free to store it’s data wherever it likes. However, if your app is storing
non-user data outside of tmp and Caches (presumably because it needs to
persist), then your app will need to exclude that data from backups using the
“do not backup” attribute. QA1719 has the details on how to do that on each
version of iOS:
[/blockcode]

My Full Question to apple:
[blockcode]
This app has been rejected because:

We found that your app does not follow the iOS Data Storage Guidelines, which is required per the App Store Review Guidelines.

In particular, we found that on launch and/or content download, your app stores 5.2 MB. To check how much data your app is storing:

  • Install and launch your app
  • Go to Settings > iCloud > Storage & Backup > Manage Storage
  • If necessary, tap “Show all apps”
  • Check your app’s storage

The iOS Data Storage Guidelines indicate that only content that the user creates using your app, e.g., documents, new files, edits, etc., may be stored in the /Documents directory - and backed up by iCloud.

What i am having a hard time understanding is the following:

If i have a app that needs to download additional content (in my case sets of flashcards that contain graphics and audio files) CAN I store these files in the “/documents” directory as long as i have the “iCloud” option turned off in the APP ID i use to build the app?

If not, where am i supposed to save download able content that is needed to play offline, but yet wont get deleted at random like items in the “/cache” directory or in the “/temp” directory.

Its unclear to me if my app failed because i violated the iCloud backup policy… OR just in general i have stored items in the /documents directory i shouldn’t have.

I also need to know this for another app i am working on that will use IAP, when i download the IAP content WHERE am i allowed to store that content?
[/blockcode]

Apple’s FULL Response:
[lua]Hi,

> If i have a app that needs to download additional content (in my case sets
> of flashcards that contain graphics and audio files) CAN I store these files
> in the “/documents” directory as long as i have the “iCloud” option turned
> off in the APP ID i use to build the app?

Unfortunately, the way we’ve marketed these technologies can make this a bit
confusing for developers. In this context, Apple uses “iCloud” to refer to
two completely different features:

-The documents in the cloud feature that apps can opt to (this is what’s
configured in the portal).

AND

-iCloud backup which allows a device to backup to iCloud rather than iTunes.

The second is an end user feature and is completely outside your control. To
make sure that feature works well, developers need to take steps to prevent
unnecessary/excessive data from being backed up, and that is the issue that’s
causing your App Review rejection.

> If not, where am i supposed to save download able content that is needed to
> play offline, but yet wont get deleted at random like items in the “/cache”
> directory or in the “/temp” directory.

First off, please read take a look at “App Backup Best Practices” section of
the iOS App Programming Guide:

http:iPhoneOSProgrammingGuide/PerformanceTuning/PerformanceTuning.html#//apple_ref/
doc/uid/TP40007072-CH8-SW9>

The general take away from those two documents is that your app is generally
free to store it’s data wherever it likes. However, if your app is storing
non-user data outside of tmp and Caches (presumably because it needs to
persist), then your app will need to exclude that data from backups using the
"do not backup" attribute. QA1719 has the details on how to do that on each
version of iOS:

http:[/lua] [import]uid: 88147 topic_id: 27845 reply_id: 327845[/import] </http:></http:>

Use native.setSync
http://docs.coronalabs.com/api/library/native/setSync.html [import]uid: 7563 topic_id: 27845 reply_id: 112719[/import]

thanks , the name of that API was just not one of the names i was looking under for iClound do not backup flag :slight_smile:

thanks for the quick response! [import]uid: 88147 topic_id: 27845 reply_id: 112720[/import]