0

I have submited my application to the AppStore, but my application had rejected.

This is a reason: enter image description here

I already work follow this link, but my application was rejected too. 2.23: Apps must follow the iOS Data Storage Guidelines or they will be rejected

Community
  • 1
  • 1

3 Answers3

3

This generally means that you're storing some data, cache files, or profile images for example, that can be recreated/redownloaded by your app, in a location that iCloud will back up. That wastes the users data, and server space for Apple. They've really been cracking down on this over the last 6 months or so.

You can either store the files in a place not backed up by iCloud (/Library/Application Support), or flag the files with the do not backup attribute.

Get that folder in code like this:

NSString* appSupportFolder = [NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES) firstObject];

Here's a category you can use to set the do not backup attribute:

@implementation NSURL (DoNotBackupAttribute)

- (BOOL)dw_addDoNotBackupAttribute
{
    if (![[NSFileManager defaultManager] fileExistsAtPath:[self path]]) return NO;

    __autoreleasing NSError* error = nil;
    if (![self setResourceValue:@(YES) forKey:NSURLIsExcludedFromBackupKey error:&error]) {
        NSLog(@"Error: failed to set do not backup attribute on file %@, error: %@", self, [error localizedDescription]);
    }

    return YES;
}

@end
Dave Wood
  • 13,143
  • 2
  • 59
  • 67
0

The problem is that your app starts by storing 252.96MB of data!

You can't design an app that way. Remember, the user has only limited storage and backup space. Apple's documentation is very clear about the rules here:

https://developer.apple.com/icloud/documentation/data-storage/index.html

You should be storing your big data only in the Caches directory, where it can be purged and where it won't be backed up.

matt
  • 515,959
  • 87
  • 875
  • 1,141
  • While 250+ meg is a lot, I've seen this rejection on an app that stored a 41 Kb file inappropriately. Which seems insane, until you consider the app could have a high volume of users and still cost a tonne for storage on the iCloud system. – Dave Wood Jun 04 '15 at 03:16
  • 1
    Good point, but my real point is that the OP has clearly not bothered to consult Apple's documentation, even though Apple told him to. – matt Jun 04 '15 at 03:17
0

If you are storing a lot of data that can be downloaded again or regenerated, you will want to store it in <Application_Home>/Library/Caches rather than the <Application_Home>/Documents directory.

Alternatively, you can prevent the device from backing up certain files to iCloud using the addSkipBackupAttributeToItemAtURL method in your app delegate.

nick
  • 18,784
  • 2
  • 24
  • 31