objective c - Don't Backup to iCloud but still rejected -


in app have store core data database , audio files, decoded put them in documents directory. prevent them backing up, when first launch app, put don't backup flag this

- (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions {  [self addskipbackupattributetoitematurl:[self applicationdocumentsdirectory]]; }     - (nsurl *)applicationdocumentsdirectory {     return [[[nsfilemanager defaultmanager] urlsfordirectory:nsdocumentdirectory indomains:nsuserdomainmask] lastobject]; } - (bool)addskipbackupattributetoitematurl:(nsurl *)url {   if (&nsurlisexcludedfrombackupkey == nil) { // ios <= 5.0.1     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 { // ios >= 5.1     return [url setresourcevalue:[nsnumber numberwithbool:yes] forkey:nsurlisexcludedfrombackupkey error:nil];   } } 

but seems doesn't work - still rejected:

we found app not follow ios data storage guidelines, required per app store review guidelines.

in particular, found on launch and/or content download, app stores 3.6 mb. check how data app storing:

  • install , launch app
  • go settings > icloud > storage & backup > manage storage
  • if necessary, tap "show apps"
  • check app's storage

and other problem can't check - don't see app in

settings > icloud > storage & backup > manage storage

maybe problem 5.0 kind of not think here?

the problem ios 5.0, in ios should not put dont backup flag dont flag introduced in ios 5.0.1 did face similar problem our app, has been rejected several times had work around handle different ioses needed support ios < 5.0, ios 5.0, , ios > 5.0

so after contacting apple, didnt find solution except have different paths on different ioses

we had function this:

+ (nsstring*) savepath {     nsstring *os5 = @"5.0";      nsstring *currsysver = [[uidevice currentdevice] systemversion];     nsstring *path = [nshomedirectory() stringbyappendingpathcomponent:@"documents"];      if ([currsysver compare:os5 options:nsnumericsearch] == nsorderedascending) //lower 4     {         return path;     }     else if ([currsysver compare:os5 options:nsnumericsearch] == nsordereddescending) //5.0.1 , above     {                 return path;     }     else // ios 5     {         path = [nshomedirectory() stringbyappendingpathcomponent:@"library/caches"];         return path;     }      return nil; } 

we used , still use function.

please read more

ios 5.0

it not possible exclude data backups on ios 5.0. if app must support ios 5.0, need store app data in caches avoid data being backed up. ios delete files caches directory when necessary, app need degrade gracefully if it's data files deleted.

http://developer.apple.com/library/ios/#qa/qa1719/_index.html


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -