iOS app submission - what happens with LocalStorage - ios

What happens to data stored in local storage when you release an iOS app update. Is it wiped completely or will it still all be available?

When a user downloads an application
update, iTunes installs the update in
a new application directory. It then
moves the user’s data files from the
old installation over to the new
application directory before deleting
the old installation. Files in the
following directories are guaranteed
to be preserved during the update
process:
<Application_Home>/Documents
<Application_Home>/Library
Although
files in other user directories may
also be moved over, you should not
rely on them being present after an
update.
You should check http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/Introduction/Introduction.html in the Performance Tunning section for more information!

Related

Application data stored in Library/Caches being persisted across app installs

I have some application state data that I am storing in the Library Caches folder, and have been noticing when I delete the app from my device, then build and run the app again, the same file exists.
Is this just a symptom of debug development or does this behaviour actually occur in production? Where else am I to store such files if I really want them to only exist per installation?

IOS: Data persistence between versions of the app

I cannot find any information on topic: what is happening when I release new version of iOS application on iTunes? Is older version on device completely replaced? Or there is a persistence of Documents folder?
Is it possible to make update to be like a "clean" installation?
When you release an update to your iOS app and the user installs it, the system does not wipe out any data from within the app.
This means that data in a given user's Documents directory, NSUserDefaults, as well as the keychain will persist between app updates.
A couple of important notes, however:
The Caches directory of an app is never reliably persisted, so if you want to make sure data stays safe, don't put it in this directory
Items in the keychain seem to persist even if you completely erase the app and re-install it. I've noticed this in the past, so it may be a good thing to keep in mind
In short, if you want data cleaned out of your app on each update (not sure why you would), you'll have to do so manually.
Your Documents folder will not be cleaned.
If you want to clear it, make sure to do it programmatically in your new release.
The Documents folder is deleted only when the user deletes the app.

Where do I properly place sqlite database so it wouldn't get removed on app update from appstore?

I am frightened to release my app using this technique to put the database on NSDocumentDirectory. what if I put on an update? will it get removed? users of the app might get really annoyed when the database will get overwritten and clear its contents?
do you think im doing it right?
https://developer.apple.com/library/ios/DOCUMENTATION/iPhone/Conceptual/iPhoneOSProgrammingGuide/PerformanceTuning/PerformanceTuning.html
Files Saved During App Updates
When a user downloads an app update, iTunes installs the update in a
new app directory. It then moves the user’s data files from the old
installation over to the new app directory before deleting the old
installation. Files in the following directories are guaranteed to be
preserved during the update process:
<Application_Home>/Documents
<Application_Home>/Library
Although files in other user directories may also be moved over, you
should not rely on them being present after an update.

Is it possible to retain data of the older version if a new version of app is deployed on device?

I am new to iOS development so my question may be n00bish.I am working on an app for iPad which downloads PDFs and stores on the device(iPad) in the Documents directory so the user can still read them if he isn't connected to WiFi. My question is:if a newer version of the app is available and the user installs it, will it delete all the data(documents,in this case) from the device? If yes,how do I prevent the old data from being deleted? I am using CoreData in this app(if this helps)
When a user installs an updated version of any app, the app's sandbox is kept intact. Only the app and its resource bundle are replaced. So basically, anything you have stored in Documents or Library will be kept intact after the update process. There is no guarantee that files in Library/Caches or tmp will be kept but those should only have transient files anyway.

How does the app-update process in the Apple AppStore work

I managed to squeeze down texture/image data for my game to 20mb to allow 3G downloads. I would like to stay below 20mb, even if my app gets updated (additional texture data). In order to allow future updates, the app copies all textures/images from the main bundle to the Documents directory (which is not altered when an app is updated). When the app starts, it checks if the required textures exist in the Documents folder. If they dont exist, textures are copied from the main-bundle to the document directory.
My updates should only contain new texture data (which is again copied to the document folder) and a modified binary. Is this possible? How does apple update ios apps? My approach only works, if updates are applied sequentially when a user decides to update an app:
1) original version is installed
2) update available -> install
3) update available -> install
...
The described approach will not work, when apple only provides the "latest" version (because all previous updates are missing).
I hope somebody can shed some light on the update process.
thanks
In your own words:
The described approach will not work, when apple only provides the
"latest" version (because all previous updates are missing).
Once you submit a new version and is approved by Apple, your previous binary will no longer be available to the consumer, your latest binary will be the only version of the application available in the AppStore.
This means that new users will only download the latest version and existing users can skip versions when updating. Versions must be standalone and not "patches" for previous versions.

Resources