Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

My iphone App got rejected with this reason "We found that your app does not follow the iOS Data Storage Guidelines,..."

Tags:

My iphone app has got rejected recently & with below mentioned reason :

"We found that your app does not follow the iOS Data Storage Guidelines, which is not in compliance with the App Store Review Guidelines."

For this app I was storing database (sqlite file) in /Documents/ directory for iOS 5.0.1 & above & for iOS 5.0 & below versions I used Library/Cache directory.

For other data like PDF & artwork images which I was downloading from server I followed the same approach as above like: iOS 5.0.1 & Later: Saved these data into /Documents/ directory iOS 5.0 & earlier versions: Saved data to Library/Cache directory.

Is this approach correct?

As per Apple guideline: Important: The new "do not back up" attribute will only be used by iOS 5.0.1 or later. On iOS 5.0 and earlier, applications will need to store their data in /Library/Caches to avoid having it backed up. Since this attribute is ignored on older systems, you will need to insure your app complies with the iOS Data Storage Guidelines on all versions of iOS that your application supports.

Also very confused about that "do not back up" attribute assignment for the data stored for iOS 5.0.1 & later. For which files i need to assign this flag ? Can i use it for database?.

Need to get rid of these rejection as it has happened twice. Please provide some guidance for storing the data for my app. Thanks in advance. Looking forward for positive response.

like image 812
Mihir Mehta Avatar asked Jan 07 '12 06:01

Mihir Mehta


2 Answers

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

specifically:

Use this attribute with data that can be recreated but needs to persist even in low storage situations for proper functioning of your app or because customers expect it to be available during offline use. This attribute works on marked files regardless of what directory they are in, including the Documents directory.

Store the SQLite db in the caches folder and set the donotbackup flag, which will stop the file being deleted by the cache clean system

- (BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)URL
{
    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;
}

I use a database in my app and store it in the cache folder (with the above flag set) and just got approved no problem.

In addition you can store your data in a subfolder of the documents directory, which I believe won't get backed up, but will persist.

like image 59
Tony Million Avatar answered Oct 11 '22 04:10

Tony Million


One of my friend has the same problem. The basic problem is You might be storing heavy data in your Application document Directory.

After iCloud is implemented in Apple, The Document directory data is somehow related with iCloud Storage. Hence Apple is now rejecting the applications using heavy data storage in document directory.

You need to store the data at some other location. Store the PDF & Other Artwork file At some other location.

This link May Help You.

http://www.techotopia.com/index.php/Working_with_Directories_on_iOS_4_%28iPhone%29

I Hope it'll Solve your problem.

like image 36
iCreative Avatar answered Oct 11 '22 04:10

iCreative