Applications must follow the iOS Data Storage Rules, nothing in / documents, but still some kbs are sent to iCloud

My application was rejected for the following reason:

Your application does not comply with the iOS Storage Guide if required by the App Store Review Guide.

Your application reserves 4.0 MB of data for each iCloud user launch space. Be sure to set the Do Not Back Up Attribute attribute for all data that is not generated or modified by the user. To check how much data is stored in the application:

  • Install and run the application
  • Go to Settings> iCloud> Storage and Backup> Storage Management
  • If necessary, select "Show all applications"
  • Check application store

IOS storage guides indicate that only content the user creates your application (documents, new files, changes, etc.) can be stored in the / Documents directory - and backed up to iCloud.

Temporary files used by your application should only be stored in the / tmp directory. Do not forget to delete the files stored in this place when the user exits the application.

Data that can be recreated, but must be stored for the proper functioning of your application or because customers expect it to be available for offline applications, use should be added with the attribute β€œdo not back up”. For NSURL objects, add the NSURLIsExcludedFromBackupKey attribute to prevent the corresponding file from being backed up. For CFURLRef objects, use the corresponding kCFURLIsExcludedFromBackupKey attribute.

From what I understand, everything that is stored in the / documents folder will be stored in iCloud, and this folder should contain only the data that was generated by the user. Now I moved all the files that were in / documents to the cache folder. However, when I test the application using the device, still about 28kb is sent to iCloud (and nothing was found in the / documents folder of this isolated window of the device’s application according to the Organizer). My project does not support iCloud, so I do not understand what is sent when there is nothing in the documents.

Is there any way to check what exactly is sent to iCloud?

In addition, my project now targets iOS 5.0. From what I understand in 5.0, there is nothing that could prevent a possible cleaning of the cache folder. Should I only support> = 5.0.1?

+2
source share
2 answers

Now I moved all the files that were in / documents to the cache folder.

Did you miss the last paragraph that you quoted? You can mark the data as β€œdo not back up” as described in this section. So, leave your files in the Documents directory and mark them accordingly.

Is there any way to check what exactly is sent to iCloud?

Point your browser to http://developer.icloud.com

+2
source

In addition, my project now targets iOS 5.0. From what I understand in 5.0, there is no way to prevent a possible clearing of the cache folder. Should I only support> = 5.0.1?

There is no way to do this in 5.0, so you should keep everything in a place that can be cleaned up by the OS, such as NSCachesDirectory . I believe that it is best to deal with all cases 5.0, 5.0.1 and 5.1; use NSCachesDirectory for 5.0 and NSApplicationSupportDirectory for 5.0.1 and 5.1. This is a mess, but as you noted, Apple quickly added a new attribute in 5.0.1 and improved the experience in 5.1.

we had rejected applications because we did not handle all the different cases, YMMV.

However, when I test the application with the device, there is still about 28kb sent to iCloud (and nothing in the / documents folder is a sandbox for application applications, according to the Organizer). My project does not support iCloud, so I do not understand what is sent when there is nothing in the documents.

This applies if the user backs up their device in iCloud, and not if you use iCloud in your application. I would not worry about the extra 28 KB, I also saw this in our applications, I think that this is probably the overhead of third-party libraries, such as analytics packages or other items that store small amounts of data in these places. As indicated, NSUserDefaults can also be stored here. You can download data from the Xcode organizer and see what is stored if you're interested.

Here is a way to handle the backup attribute not in 5.0.1 and 5.1.

 + (BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)URL { if (&NSURLIsExcludedFromBackupKey == NULL) { // Use iOS 5.0.1 mechanism const char *filePath = [[URL path] fileSystemRepresentation]; const char *attrName = "com.apple.MobileBackup"; u_int8_t attrValue = 1; int result = setxattr(filePath, attrName, &attrValue, sizeof(attrValue), 0, 0); return result == 0; } else { // Use NSURLIsExcludedFromBackupKey mechanism, iOS 5.1+ NSError *error = nil; BOOL success = [URL setResourceValue:[NSNumber numberWithBool:YES] forKey:NSURLIsExcludedFromBackupKey error:&error]; //Check your error and take appropriate action return success; } } 
+1
source

All Articles