1

2.23 Details

On launch and content download, your app stores 6.32MB on the user's iCloud, which does not comply with the iOS Data Storage Guidelines.

Next Steps

Please verify that only the content that the user creates using your app, e.g., documents, new files, edits, etc. is backed up by iCloud as required by the iOS Data Storage Guidelines. Also, check that any temporary files used by your app are only stored in the /tmp directory; please remember to remove or delete the files stored in this location when it is determined they are no longer needed.

Data that can be recreated but must persist for proper functioning of your app - or because users expect it to be available for offline use - should be marked with the "do not back up" attribute. For NSURL objects, add the NSURLIsExcludedFromBackupKey attribute to prevent the corresponding file from being backed up. For CFURLRef objects, use the corresponding kCRUFLIsExcludedFromBackupKey attribute.

Resources

To check how much data your app is storing:

- Install and launch your app
- Go to Settings > iCloud > Storage > Manage Storage
- Select your device
- If necessary, tap "Show all apps"
- Check your app's storage

For additional information on preventing files from being backed up to iCloud and iTunes, see Technical Q&A 1719: How do I prevent files from being backed up to iCloud and iTunes.

If you have difficulty reproducing a reported issue, please try testing the workflow described in Technical Q&A QA1764: How to reproduce bugs reported against App Store submissions.

I searched a lot throught internet about this problem. Seems that plenty of people are experience this problem nowdays.

Following their link of Technical Q&A 1719: How do I prevent files from being backed up to iCloud and iTunes. i set to yes the NSURLIsExcludedFromBackupKey to prevent backing up my CoreData model as is the only thing i store in /Documents/ of the App.

Another extrange thing is that i didn't enable CoreData in my App and when i go to Settings > iCloud > Storage > Manage Storage i don't see my App. I see only TextEdit, the only app that uses iCloud i suppose. I only see my App under Settings > General > Storage & iCloud Usage > Manage Storage (but of the Storage section, not of iCloud) > and there i see the under Documents & Data I'm using 800Kb not 6.32Mb (but obviously as much as you use the app the more it downloads and store).

My App doesn't download any image from internet so need to be the database what is using this space. Apart from CoreData i use AFNetworking and just other frameworks to display a HUD and make an Excel table in a specific view but none of them download things so I'm 99% sure that is CoreData model what is using that space.

After setting that key to true i sent another time the app but the answer was the same, with the same amount of Mb (extrange...) because to achieve that amount of Mb downloaded the user should navigate throught the app and i don't think that different tester will enter to exactly the same view and options. The problem is that they answer that i can't publish my app.

Is there anything else i can do? Because i want to store the content that the app downloads from internet to use it for offline mode and to avoid making requests to server all the time.

Any recommendations?

Thanks in advance.

Miguel
  • 558
  • 6
  • 21
  • Refer this link to get idea->http://stackoverflow.com/questions/13682859/prevent-app-from-backing-up-documents-folder – RJV Kumar Apr 27 '16 at 07:37
  • That's what i made (explained here: https://developer.apple.com/library/ios/qa/qa1719/_index.html) and didn't worked. – Miguel Apr 27 '16 at 07:54

3 Answers3

1

If you don't need to back up the CoreData store, i.e., it only contains information downloaded that can be downloaded again, and doesn't contain any user content or settings, then, I would recommend you place the CoreData store in the app's cache directory instead of the documents directory. The cache folder's contents are not backed up to iCloud.

When placing the CoreData store in the Documents folder, depending on your settings, it could create additional files (binary files, log files etc), and these can grow quite large. Applying the NSURLIsExcludedFromBackupKey flag on the main store, won't affect these additional files and so you'll still be rejected.

If you're storing some user data, or settings in CoreData as well, then you may want to back that up. You can look into using CoreData configurations. That will allow you to break up the CoreData store so that user info can be backed up, while downloaded data is not.

Dave Wood
  • 13,143
  • 2
  • 59
  • 67
  • But i looped throught all files of /Documents there were 3 files one my CoreData model and other 2 with a different ending. I set the NSURLIsExcludedFromBackupKey for all not only for the main store. I would prefer to know how to change settings and disable logs, binary files, etc than moving CoreData to cache. The reason is that one entity has few attributes that can be changed by the user. If possible i wouldn't like to loose that info and i searched throught internet and they don't reccomend store coredata in cache directory. I saw that maeby would be better to use library for coredata. – Miguel Apr 27 '16 at 06:54
  • Storing your CoreData files in the cache directory is common practice when CoreData is being used as a cache. That's exactly what that folder is for. The additional files, binary files, log files etc, are used by CoreData for efficiency, it's unlikely you'll want to turn them off. If you want to back up the one entity, look at CoreData configurations. It lets you specify that one entity should go in one store, while the rest in the main store. Then you can have it back up just that one store. See: https://lists.apple.com/archives/Cocoa-dev/2005/Jul/msg02544.html for more info. – Dave Wood Apr 27 '16 at 07:04
  • I think the only possibility will be to move it to cache because the main entity is the one that can be modified some attributes by the user. All other entities are related with this one. I will try to store coredata in the cache directory. Do you have any example of how? – Miguel Apr 27 '16 at 11:21
0

I have also got this error few weeks before. Use below code and you will get rid of that problem. And also in info.plist add "NSURLIsExcludedFromBackupKey" and set its value to "YES".

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *basePath = ([paths count] > 0) ? [paths objectAtIndex:0] : nil;
NSArray *documents = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:basePath error:nil];
NSURL *URL;
NSString *completeFilePath;
for (NSString *file in documents) {
    completeFilePath = [NSString stringWithFormat:@"%@/%@", basePath, file];
    URL = [NSURL fileURLWithPath:completeFilePath];
    NSLog(@"File %@  is excluded from backup %@", file, [URL resourceValuesForKeys:[NSArray arrayWithObject:NSURLIsExcludedFromBackupKey] error:nil]);
    [URL resourceValuesForKeys:[NSArray arrayWithObject:NSURLIsExcludedFromBackupKey] error:nil];
}


return YES;
}

I got rid of the problem by doing this. and my app is accepted on app store

Asad Ali
  • 55
  • 6
  • but you problem was related to storing CoreData in the Documents folder? – Miguel Apr 27 '16 at 07:55
  • I exactly got the same error from Apple. If you are using core data or not, this code will help, because it helps me too and my app got accepted on itunes – Asad Ali Apr 27 '16 at 07:58
  • As i said i made that and app has been rejected too, provably related with what Dave Wood said in their answer related with binary files, log files etc made by CoreData. That's the reason i asked you if you used CoreData too. – Miguel Apr 27 '16 at 08:25
  • This is a bad hack. Blindly flagging all files in the documents folder as 'Exclude From Backups' is just asking for trouble down the road. – Dave Wood Apr 27 '16 at 08:27
  • @DaveWood yes i know is a bad practice but at least should work however it doesn't as Apple also rejected the app. – Miguel Apr 27 '16 at 11:19
-1

I had answered a similar question in Binary Rejected once again. How to do?. I'm posting the same answer here too.

You are using iCloud wrongly. See this by Apple: https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/iCloud.html

Respect the user’s iCloud space. It’s important to remember that iCloud is a finite resource for which users pay. You should use iCloud for storing information that users create and understand, and avoid using it to store app resources or content that you can regenerate. Also, note that when the user’s iCloud account is active, iCloud automatically backs up the contents of your app’s Documents folder. To avoid using up too much of the user’s space, it’s best to be picky about the content you place in the Documents folder.

Use minimal amount of iCloud space and avoid using iCloud to store resources and other data which you can reproduce later, in iCloud space.

Community
  • 1
  • 1
Ayath Khan
  • 213
  • 2
  • 10
  • Then I think they would have mistakenly rejected your app. Check the size of data that you're pulling from web services. – Ayath Khan Apr 27 '16 at 06:53
  • And if everything is okay, resubmit the app without any change. If the previous reject was by a mistake, your app might get accepted. – Ayath Khan Apr 27 '16 at 06:55