Using the Sqlite sample app I noticed that after building and deploying a second time in Appbuilder existing data are gone.
Will this also happen after updating an app deployed to appstore? If so, how can data be preserved?
Thanks
1 Answer, 1 is accepted
0
Martin
Telerik team
answered on 10 Jan 2017, 02:56 PM
Hi Per,
On iOS when you distribute updates of the app, the file in the bundle is replaced/updated, but the user's copy in the Documents or Library folder stays there unless you explicitly remove it programmatically (or the user manually uninstalls the app). Therefore updating your application won't delete the database file stored in the documents or library directory (but if it is in your bundle, it'll be removed).
To store the SQLite file in the documents or library forlders, upon creating/opening the database in your app you may set iosDatabaseLocation: 'Library' .
Additionally, Apple's file system programming guide for iOS describes the (application_home)/Library path as a place to "create custom subdirectories for files you want backed up but not exposed to the user". The (application_home)/Documents path is described as "the contents of this directory can be made available to the user through file sharing."