SQLite DB being rejected by Apple?

Help!!

I have followed the guidance for SQLite DB and using db_copy to persist my database to the phones storage. Apple keep telling me that my app doesn’t meet their iOS Data Storage Guidelines or they will be rejected, but I cant’ work out where not, and it reads that my app should. I’m really need of some help now!

I have the following in my web config, could any one of these be the issue?

<preference name="iosPersistentFileLocation" value="Library"/>
  <preference name="iosPersistentFileLocation" value="Compatibility"/>
  <preference name="AndroidExtraFilesystems" value="Internal,files,files-external,documents,sdcard,cache,cache-external,root"/>
  <preference name="iosExtraFilesystems" value="library,documents"/>
  <preference name="BackupWebStorage" value="none" />
  <preference name="SplashScreen" value="screen"/>
  <preference name="SplashScreenDelay" value="3000"/>
    <preference name="target-device" value="handset" />

I know you had posted this question on my blog, but just so information gets shared across the board, everyone with this issue should visit here:

Seems to be a known issue with the plugin and the developer is aware of it.

Regards,

Hey Nic, thanks for joining the dots, I’ve just been out in town, but had a similar post ready to go!

Just trying some of the suggestions in the post to see if I can get it up and running and passing the apple tests.

back soon

Ok I have a working solution which I am just about to upload to Apple. This is taking some information from the above link, and from applying a bit of common sense.

Step 1 : Find the file SQLitePlugin.m and go to line 170 ish. Now put the below lines:

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES);
NSString *libraryDirectory = [paths objectAtIndex:0];
libraryDirectory = [libraryDirectory stringByAppendingString:@"/NoCloud"];
NSError *err = nil;
[self setAppDocsPath:libraryDirectory];

In place of :

NSString *docs = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex: 0];
NSLog(@"Detected docs path: %@", docs);
[self setAppDocsPath:docs];

What this does is to tell the SQLitePlugin where to look for your database. The bit you are still missing is to get dbcopy to copy the .db file from the resources directory into the correct directory on the phone. To do this I did the following:

Step 2: Find and open the plugin file sqlDB.m:

Find the below:

paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
documentsDirectory = [paths objectAtIndex:0];

Replace with :

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES);
NSString *libraryDirectory = [paths objectAtIndex:0];
libraryDirectory = [libraryDirectory stringByAppendingString:@"/NoCloud"];

That’s it your app is back into a working state and now uses the Library/NoCloud directory rather than the Documents directory on the iphone.

I’ll let you know if this solves the issues for Apples tests.