davibe / Phonegap-SQLitePlugin

A phonegap plugin to open and use sqlite databases on iOS.
192 stars 90 forks source link

app rejected "2.23 Apps must follow the iOS Data Storage Guidelines" #26

Open alexkemp opened 12 years ago

alexkemp commented 12 years ago

I implemented the SQLitePlugin and my app got rejected because Apple says it didn't follow the iOS Data Storage Guidelines, mainly I think because the database is stored in the Documents folder.

I followed their technical page and included a "do not backup attribute" so the data don't get backed up by iCloud:

/**

{

assert([[NSFileManager defaultManager] fileExistsAtPath: @"myDatabase.sqlite3"]);

NSError *error = nil;

BOOL success = [URL setResourceValue: [NSNumber numberWithBool: YES]

                              forKey: NSURLIsExcludedFromBackupKey error: &error];

if(!success){

    NSLog(@"Error excluding %@ from backup %@", [URL lastPathComponent], error);

}

return success;

}

/**

I resubmitted the app and still got rejected with the same reason (with no further details).

Have folks encountered this issue and how to resolve? Appreciate any advice as I'm pressing to get this app submitted.

xcode 4.3.2 PhoneGap v1.4.1

davibe commented 12 years ago

Can't you just use a different folder instead of documents ?

Could you paste the apple response ?

I use the plugin for applications that do not have to be happroved since they are distributed in ad-hoc mode (enterprise deployment).

tsathish commented 12 years ago

Alex, hope you would have got your app approved. I too have a similar issue, could you throw some light on the solution you had?

Thanks.

Sathish

alex-swiftify commented 11 years ago

alexkemp, tsathish: Could you please share your experience on getting your app(s) approved? I'm in the same shoes right now - going to do the first submit to AppStore. I'd rather keep my SQLitePlugin database in the Documents folder and set a "do not backup" attribute, but due to your experience I may rather want to change the database location to /Library/Caches.

Note: my database contains both pre-populated and user generated data, which is important. I do not want anything backed up in iCloud for some reasons.

tsathish commented 11 years ago

Crulex, I store the the support files for the application in the NSApplicationSupportDirectory, as mentioned in the link http://developer.apple.com/library/ios/#qa/qa1719/_index.html. The link has source code to exclude content from back-up for multiple versions. I did store my files only in the application support directory irrespective of the version (5.0 0r 5.1). I submitted by app 2 weeks ago and got it approved last week. After seeing your comment, It just struck me that I missed the check of iOS versions to choose between Library/Caches and ApplicationSupport directories based on the OS version. May be you should take care of it before you submit your app. All the best! Additional info on the App folders available at http://developer.apple.com/library/mac/#documentation/FileManagement/Conceptual/FileSystemProgrammingGUide/FileSystemOverview/FileSystemOverview.html.

alex-swiftify commented 11 years ago

tsathish: thanks for pointing out to using Application Support directory! We're targeting IOS 6 only at least with our first submitting to AppStore, but I still have few concerns.

Our database contains both pre-populated and user generated data. Currently it's saved to the Documents folder and iPad displays the amount of iCloud storage used by our app as 4 MB. Now I think I should store by SQLitePlugin database in Application Support directory and apply the com.apple.MobileBackup extended attribute to them, but I have the following concerns:

  1. According to Apple guidelines on https://developer.apple.com/library/ios/qa/qa1719/_index.html : Important: Apps should avoid mingling app data and user data in the same file. Doing so will unnecessarily increase backup sizes and can be considered a violation of the iOS Data Storage Guidelines. Since we have a HTML5 / JavaScript application with a single database, and most of the data is user-generated, I see no easy possibility to split the database into user-generated and pre-populated content. Do you think this may cause my app to be rejected?
  2. I read the following in https://issues.apache.org/jira/browse/CB-1561 : The iOS Data Storage Guidelines indicate that only content that the user creates using your app, e.g., documents, new files, edits, etc., should be backed up by iCloud. Also: Every data generated by the user must be backup by iCloud. Thus the question - won't Apple reject our app for not backing up important and user generated data into iCloud?

I'd be thankful for your suggestion(s) regarding what approach will minimize the chance for our app to be rejected.