Hassan Waheed
Hassan Waheed

Reputation: 63

Rejected by apple due to the sqllite db in documents folder

I have sqlite db using FMDB wrapper that puts the db in documents folder on launch. User can also upload files through itunes in documents folder.

But appstore rejected the app as following:

When file sharing is enabled, the entire Documents folder is used for file sharing. Files that that are not intended for user access via the file sharing feature should be stored in another part of your application's bundle. If your application does not require the file sharing feature, the UIFileSharingEnabled key in the Info.plist should not be set to true.

Is there any workaround to put db in some place or restrict in documents folder so that it gets approved by apple.

Upvotes: 3

Views: 1319

Answers (1)

Reno Jones
Reno Jones

Reputation: 1979

You will have to change the path of the file from document directory to Cache Directory:

Search for this in your code 'NSDocumentDirectory' and replace with 'NSCachesDirectory' and let everything be same then your database will auto moved to cache directory on launch and apple won't reject it as well. :)

Hope it helps.

EDIT: To set your own database path, pass 'cacheDirectoryPath' string in your code instead of your path, below code will create this cacheDirectoryPath for you:

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
    NSString *cacheDirectoryPath = [paths objectAtIndex:0];

Upvotes: 4

Related Questions