Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

App rejected for storing database in Documents directory

My app was recently rejected from the app store for storing data in the Documents directory. I had moved it there because with the latest change, the db must now be writeable - it's no longer read-only.

In researching the solution, I've read that it's actually preferable to use NSLibraryDirectory. Is this so, and more importantly, will that address Apple's concerns? Their complaint is that the app lets the user download to much content (it doesn't let the user download any unless you count the db), and that it's storing "too much data" in the "incorrect location." The data is 8 mb, but could grow to about 10 or 12 mb max.

like image 759
Jack BeNimble Avatar asked Feb 23 '23 01:02

Jack BeNimble


2 Answers

Actually its because of iCloud.

using iCloud, Application's document directory is synced to cloud and to other devices and hence Apple want developers to store only that data in document directory which they want to sync with iCloud.

I came to know this form one of my friends who work @ Apple California and I'm not really sure if this material is on Apple's documentation.

like image 114
Saurabh Passolia Avatar answered Mar 02 '23 14:03

Saurabh Passolia


I had this issue with an update to a suite of apps I develop the other week. The funny thing was that only five of the seven apps (exactly the same code base) were rejected.

I believe the issue in my case was duplicating assets from the .app bundle into ~/Documents.

My first attempt to comply with their new storage guidelines was to implement the do not backup switch on the files I was copying into ~/Documents. No deal with that so I had to change my implementation to not copy the data at all. The apps were promptly approved.

Your implementation is probably different but in my experience Apple no longer likes you copying things from the app bundle into ~/Documents, as it could be duplicating data unnecessarily (in their view).

They suggest copying into ~/Caches (or whatever it is), but this can be cleared in low storage situations and may not be right for your case either.

Hope that helps.

like image 30
Jessedc Avatar answered Mar 02 '23 16:03

Jessedc