[TIMOB-6273] Database installation folder issue related to iCloud
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-12-06T16:25:33.000+0000 |
Affected Version/s | Release 1.7.5, Release 1.8.0, Release 1.8.0.1 |
Fix Version/s | Sprint 2011-49, Release 1.7.6, Release 1.8.0.1 |
Components | iOS |
Labels | n/a |
Reporter | Qing Gao |
Assignee | Stephen Tramer |
Created | 2011-11-21T16:50:09.000+0000 |
Updated | 2012-02-03T16:09:21.000+0000 |
Description
Since iOS 5 and iCloud integration Apple has stated that the database should be placed according to iOS Data Storage Guidelines but Ti.Database.install always installs database into the Library/Application Support/database folder. Apple rejects Apps which does not follow this rule. We need to change our SDK accordingly.
When this bug will be fix ? Really annoying. Thanks.
Databases will actually need to be stored in either
<Application_Home>/Documents
or<Application_Home>/Library/Private Documents
. See this QA note: https://developer.apple.com/library/ios/#qa/qa1719/_index.htmlTESTING
---- SIMULATOR: *NOTE:* Paths for earlier apps which ran the database test may still have the old path in them (Application Support/database
). You should clean your simulator apps directory before running this test.Launch KitchenSink -> Platform -> Database
Click the buttons on the test and verify output
In the Terminal app on your desktop, go to
$HOME/Library/Application Support/iPhone Simulator/5.0/Applications
Run the following command:
#* All results should include the pathfind . -name 'mydb.sql'
Library/Private Documents/mydb.sql
Run the following command:
#* All results should include the pathfind . -name 'quotes.sql'
Library/Private Documents/quotes.sql
DEVICE: Run only steps 1 & 2 above SUBMISSION: If possible (i.e. you have a distribution certificate) submit an app which uses databases (this requires manual review from Apple, I assume) and check for any rejection messages containing the following: {quote} We found that your app does not follow the iOS Data Storage Guidelines, which is not in compliance with the App Store Review Guidelines. In particular, we found that the app is storing too much data in the incorrect location. {quote}Closing bug. Verified fix on: OS: Mac OS X Lion Titanium Studio, build: 1.0.7.201112060130 SDK build: 1.8.0.1.v20111205164258 Devices: iOS Simulator 4.3, iOS Simulator 5.0, ipod 3rd Gen (4.0.2), iphone 4S (5.0.1), ipad 2 (4.3.5) Note: Did not test for SUBMISSION. As per Thomas, we do not have anything to submit to the Apple Store.
There are some real cases from customer's Apps approved by Apple in the associated helpdesk ticket.
Do we need to set Library/Private Documents/ with the DNBU flag ? (if yes, how ?) Thanks.
heenok - You can (and it's recommended). There's a new property on
Titanium.Database.DB
calledfile
, which returns aTitanium.Filesystem.File
object. On this object, you can set the DNBU flag via theremoteBackup
property, by setting it tofalse
. Note that this actually prevents ALL backups, not just to iCloud.Tested again. Did not find any new bugs. Verified on: OS: Mac OS X Lion SDK build: 1.8.0.1-20111216011148 Titanium Studio, build: 1.0.7.201112152014 Devices: iOS Simulator 4.3, iOS Simulator 5.0, iPhone (5.0.1) Note: Did not test SUBMISSION. QE already submitted an app around the time of this writing.
I apologize if I am completely out of order by posting here. But according to the iOS Data Storage Guidelines: "1. Only documents and other data that is user-generated, or that cannot otherwise be recreated by your application, should be stored in the
Martijn - This is a feature request. Please feel free to file one.
Will do. Apart from that I think I also found that the migration of an existing database in the Lib/App support/database does not work. After installing my app on my iPhone for testing I had lost all my data and my default "master" database was used instead. Inspecting the app's data folder showed that the original app support/database db was still there, and a new default database was created in private documents. 1.9.0.v20111216103134
Martjin - Can you file a bug for that as well, along with a test case that you can verify demonstrates the problem?