Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-6273] Database installation folder issue related to iCloud

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-12-06T16:25:33.000+0000
Affected Version/sRelease 1.7.5, Release 1.8.0, Release 1.8.0.1
Fix Version/sSprint 2011-49, Release 1.7.6, Release 1.8.0.1
ComponentsiOS
Labelsn/a
ReporterQing Gao
AssigneeStephen Tramer
Created2011-11-21T16:50:09.000+0000
Updated2012-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.

iOS Data Storage Guidelines

http://developer.apple.com/icloud/documentation/data-storage/

Associated Helpdesk Tickert

http://appc.me/c/APP-316734

Comments

  1. heenok 2011-11-30

    When this bug will be fix ? Really annoying. Thanks.
  2. Stephen Tramer 2011-12-06

    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.html
  3. Stephen Tramer 2011-12-06

    TESTING

    ---- 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: find . -name 'mydb.sql'

    #* All results should include the path Library/Private Documents/mydb.sql

    Run the following command: find . -name 'quotes.sql'

    #* All results should include the path 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}
  4. Wilson Luu 2011-12-06

    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.
  5. Qing Gao 2011-12-06

    There are some real cases from customer's Apps approved by Apple in the associated helpdesk ticket.
  6. heenok 2011-12-15

    Do we need to set Library/Private Documents/ with the DNBU flag ? (if yes, how ?) Thanks.
  7. Stephen Tramer 2011-12-15

    heenok - You can (and it's recommended). There's a new property on Titanium.Database.DB called file, which returns a Titanium.Filesystem.File object. On this object, you can set the DNBU flag via the remoteBackup property, by setting it to false. Note that this actually prevents ALL backups, not just to iCloud.
  8. Wilson Luu 2011-12-16

    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.
  9. Martijn Kooij 2011-12-16

    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 /Documents directory and will be automatically backed up by iCloud." shouldn't we at least be able to indicate that our Ti.Database is indeed user-generated and does indeed require to be synced and backed up?
  10. Stephen Tramer 2011-12-16

    Martijn - This is a feature request. Please feel free to file one.
  11. Martijn Kooij 2011-12-16

    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
  12. Stephen Tramer 2011-12-16

    Martjin - Can you file a bug for that as well, along with a test case that you can verify demonstrates the problem?

JSON Source