Application rejected to store the database in the Documents folder

My application was recently rejected from the application store for storing data in the Documents directory. I moved there because with the last change, db should now be writable - it is no longer readable.

While researching the solution, I read that it is actually preferable to use NSLibraryDirectory. Is this the case, and more importantly, is it about Apple? Their complaint is that the application allows the user to download a large amount of content (this does not allow the user to download any files if you do not consider db), and that he stores "too much data" in the "wrong place". Data is 8 mb, but can grow to 10 or 12 mb.

+4
source share
4 answers

Actually, this is due to iCloud.

using iCloud, the application’s document catalog is synchronized with the cloud and other devices, and therefore, Apple wants developers to store only this data in the document catalog that they want to synchronize with iCloud.

I recognized this form, one of my friends who work @Apple California, and I'm not sure if this stuff is in the Apple documentation.

+6
source

I am having a problem updating the suite of applications that I am developing next week. The funny thing is that only five of the seven applications (exactly the same code base) were rejected.

I believe the problem in my case was duplicating the assets from the .app package to ~ / Documents.

My first attempt to comply with my new retention rules is to implement the do not backup switch in the files that I copied to ~ / Documents. No deal with this, so I had to change my implementation so as not to copy the data at all. Applications were quickly approved.

Your implementation is probably different, but in my experience, Apple no longer likes it when you copy things from the application package to ~ / Documents, as this could be duplicating data unnecessarily (in their opinion).

They offer copying in ~ / Caches (or something else), but this may be cleared in low-storage situations and may be wrong for your case.

Hope this helps.

+1
source

The product I wrote a year ago uses CoreData (with SQLite datastore). This database file is stored in ~ / Library / Application Support //. It was approved by Apple without any problems.

"Application Support" does not exist in ~ / Library, so you will need to create it.

Documents are not a great place to store a database file for several reasons. Apple has its own reasons because they rejected your application. Another reason is that the document catalog is accessible to the user (via iTunes), and if the user does not delete the database file, it does not matter much for your application to work, it is best to place it where they cannot do anything directly with it and / or unintentionally.

+1
source

You can put these files in the Documents folder, you just need to provide them with an attribute that allows the file system not to support them in iCloud

This is a great example of how to do this in different versions of iOS.

0
source

Source: https://habr.com/ru/post/1387674/


All Articles