Data BACKUP on VERSION UPDATE. App Store - iphone

I am a little curious what happens in the situation when the user downloads a new version of application from App Store. I have an existing app, an eBook reader on the iTunes store (downloaded with customers).
Assuming that the customers have downloaded books to the existing version of application onto their iPad, now that a new version is available on app store & user downloads the same along with the app update i want the user downloaded books(on the previous version) to be backed up when a new updated version is installed.
Currently in my application i'm string these books in Caches Directory of Application Sandbox.
If there is a possibility of doing this, please provide some references?

A proper update will not remove the previous content of your sandboxed folders - hence I do not see a reason for a backup. Proper update means the user uses the iTunes update functionality.
Only once the user entirely removes the previous version and then installs the new version, the sandboxed files of the previous version will be gone.

Related

How do I update my app with a new build version?

I already have an app published on the app store but I have made changes and want to submit a newer version. How do I do this? Do I have to make a complete new app version and enter every detail again?
What about the data inside the app will people who used my app lose all the data on the app?
Hi and welcome to stackoverflow. To update an iOS app, you will need to re-use the exact same bundle ID as the previous version and increment / increase the version number. Same applies to subsequent builds submitted to App Store Connect.
1) In Xcode make sure to use the exact same bundle identifier (You can look it up on https://appstoreconnect.apple.com if you can't remember it)
2) Then set the Version to the new version. This does not need to be the exact same as on App Store Connect (which is the customer facing number), but I can only highly recommend using the same to not get confused.
2A) If you already have a build uploaded for the new version, you need to increment the build version as well. (i.e. if you have build 1.0.0, next one can be 1.0.1)
3) Create a new version of your app on App Store Connect. This can be done independently from your work in Xcode and you can even upload a new build even though there is no new version yet.
Any changes inside your build requires a new update for you app.
How do I do this?
First you have to add a new version in AppStore Connect. The only thing which is required is the text for the update i think, the rest is optional(Screenshots etc.).
After that you can upload a new version from Xcode (or Application Loader).
- increase the build number of your build target
- archive your app and upload it to AppStore Connect.
After a while your build is available in AppStore Connect and you can add it to your new version and send it to review.
What about the data inside the app will people who used my app lose all the data on the app?
Files in the documents directory will not be deleted if a user updates your app
Data in the UserDefaults will also not deleted
Files in the cache directory can be deleted every time

How Update does work for iPhone App?

I would like to know how updates work for the Apple store.
Does Apple delete all the old data related to the old version of the application and then update to the newer one?
When a user updates to a new version of any application, does the older version get deleted from their iPhone with all data ( pictures, database, sound,etc) and get replaced by the newer version or not?
I updated my application a few days ago, and I think that Apple does not replace the old SQLITE database with the newer one.
During update old application bundle is replaced by the new one. All other folders and so their contents in application sandbox (Documents, Library, tmp) remain untouched.
So if you want to replace old database (if you must save data changed by users in old database) you just need to check database version in your app and copy the new one from application bundle if version is old (you can use sqlite user_version pragma for version tracking)

Upload an app's update to the app store !

I have an app that is already existing on the app store ,But now i made its updates means i updated its UI its OS compatibality and other thing that will make help to run on the newer os now i want to put it on as a update to the existing user of the app and if a user have never this application then it will be a fresh application to him,How can i do that .? i was planning to make its plist version 1.2 but i think it will then not replace the app from the app store and for a new user there will be 2 app for the same build. HOw can we do that .......
You're over thinking this.
Increment your version number.
Log into iTunes Connect. Click on your application. Click the 'Add Version' button.
Go through the steps to submit your latest build with it's updated version. Once approved new users will be able to download it, and existing users will be able to update to it. There will not be two versions on the app store - just one; your latest.
Apple have thought this through for you ;)
If you update your app on the AppStore the old version is removed once the update is approved. The new version will replace the existing one. Your app will not show up in the AppStore with 2 different versions.
Users who have the old version will see an update. New users will only be able to install the newly added update.

How to reinstall the iPhone app in ad hoc distribution

I am using ad hoc distribution for my iPhone app. It works very well. The only problem is when I update my app or create a new binary and want to install this new version on device, I need to delete the old version. Like although I drag and drop the new version in iTunes application, it does not over write the previous version even after I do sync. It might be becoz the app already exists in the device. So I need to delete it to reinstall it. How do I make sure the app gets updated to the new version and I dont loose the data from the previous app. Data I mean the database. Please note I am just formating the UI and not even touching the database.
I've found that you must increase the version number in your main plist file for iTunes to install a new version of your app.

How the application upgrade works in iPhone

I am planning to post an application for iPhone in iTunes Store. Soon I am gonna provide an upgrade for it. But later to current version. I want to know how the upgrade system works in iPhone. Like does it replaces the whole application and reinstall it deleteing the previous database or it adds the new version keeping the database and all the same.
Upgrades replace the app bundle, but anything else in your sandbox (like the Documents folder, caches, preferences, etc) are preserved in place.