Updating iPhone app removed the older version data - ios

I am developing a social application for iOS using Objective-c. But when I published the newer version of my app and upgraded it using App Store, all of my older application data has been removed while every thing in both versions is the same like Bundle Identifier, Provisioning Profile, Signing Certificate. But I am confused why some thing like that happened. I was wondering if anyone could help me. This is too important for me, because this problem forces users to register again in the application.
update: I save data in the documents and also using core data

It might not be cleared just the path of the files changed, for example lets say you save the path of a photo like this :
/data/Containers/Data/Application/B42FE84A-E031-4A2C-AEA7-8D77AEAA389C/Documents/Photo.jpg
when you update the app the path will look like this because iOS will change app documents folder
/data/Containers/Data/Application/757455E1-355B-4040-8ABB-85F39D650A1E/Documents/Photo.jpg
so the file still exist but the path have changed and since you are saving the path the app won't find it because it was changed
i recommend saving only file name not the whole path

Related

Fetching previous saved database file after reinstalling the app

I am new to ios development so please pardon if I am asking a silly question.
I need to check if my sql file from the previous installation of the same app exists in the device directory already. If yes, then I need to fetch that file instead of making the new one. But the bundle folder of the app changes after reinstalling the app. So I cant guess the name of the previously installed app bundle folder. I tried to save it elsewhere on the device, but it isn't allowing me. Please suggest me the solution.
What you're asking for isn't possible. If an app is removed, all its files are deleted as well. In iOS, there is no app-neutral place to store files. When an app is merely updated, the update happens "in place" from the perspective of the app, and all previous files are available.
If you want files to survive a delete-reinstall cycle, you'll have to use a cloud service, such as iCloud, Dropbox or Google Drive.
once app is deleted. Application bundle and document directory and all files (including SQLite file)are deleted. u have to fetch all data from API.
In iOS each application is a Sandbox. This Sandbox consists of Application bundle and Mutable part where you store your database and other files which are mutated during the life span of an application.
When you delete the application, entire Sandbox is removed. The only thing which does not get remove is the data which you have stored in keychain.
When you update the application, only application bundle gets updated and Mutable part remain un-touched. So while re-installing the application when it is already present (technically updating the existing application on the device), you can find the same file from the same location.
You can do one thing you can take daily backup of that file on remote server and when you reinstall app check that file exist on server if exists than download else create new.

How to check previous version app already installed in iOS Device?

it assumes very simple question but its typical problem for me .
I have a live paid iOS app in App Store . I want to update it in my phone with new Sqlite .
I want test some scenario for that I want installed update from my Xcode in free.
How can i update app installed from App store by Xcode as i have new code of that app.
in my live app there in no USERDEFAULTS to store current version.i can code in new app.
How to delete previously used sqlite and installed new app free if already buy that app.
Thanx for reading.
guide me if any understand it and any idea about it.
Thank in advacnce
http://blog.digidna.net/post/74246563623/how-to-release-a-whole-new-app-and-keep-all-things this was i want
SQLite database file is just a normal file, you do not need any special steps to update it.
Get the file path or URL to the SQLite file , and use
NSFileManager's method removeItemAtPath:error: or removeItemAtURL:error:
Then create the new database the same way you created the old one.
Also check this link if get any problem.
EDIT :
You can delete your old SQlite database file if it's copied in document directory. You CAN NOT delete files from bundle.

iOS app updating process

Apologies if this has been asked before but I couldn't find anything specific to my situation..
I've been tasked with creating a new version of an app already on the market place.
Unfortunately, the client only has access to the binary and not the source code as the previous development team didn't provide this information.
The client has been unable to get in touch with the previous development team so I can assume getting a hold of the original source code is off the table.
I was wondering, in a case like this, how does the iOS upgrade procedure work?
As an additional question, is it possible for the new app to access the data stored by the old app and if so, can anyone point me in the right direction on how to go about doing this please?
Thank you!
To make the update you must have the same bundleIdentifier as the current version. This will be displayed in iTunes Connect.
To get the stored data, you should use a tool called iFunBox.
Here's a little tutorial on how you can do it:
Steps for using iFunBox
Download the current version of the app
You should also use the apps functions, so the app saves the data you wish to extract.
Connect your iDevice to your Mac/PC
Download and install iFunBox (link here: http://www.i-funbox.com)
Launch the program and navigate to your device
Press "User Applications", then your application
Find the data the app stores
The NSUserDefaults plist-file is located in "Library" -> "Preferences" and is called com.yourCompany.appName.plist
A lot of apps also stores files in yourApp/Documents/
You can also explore the apps folder and look for the data you need. Hope this helps :)
If you have access to the iTunes Connect account, with which this app was published the problem is not too large: you can update app with any binary that have the same application id (bundle identifier) and larger version number.
You definitely can have access to the data of previous version - either it's stored in NSUserDefaults or app Documents folder etc., but you should have a clue of its format (e.g. keys of NSUserDefaults) - some reverse engineering of binaries can help.
You must know the bundleIdentifier and use the same otherwise the apps wont update.
The version number must also be higher than the current one
Also the data saved in the old app can be read but you need to know in which format it is.

IOS Enterprise Distribution update keep user data?

I'm making an iPad app which will be distributed from my own web server using Enterprise Distribution Program.
The app itself checks for a newer version on the server and calls itms-services in IOS to update itself. This works perfect.
The app bundle contains a directory with resources like images and movies.
Apple claims that updates will keep the users data if the bundle-identifier is the same.
From: http://help.apple.com/iosdeployment-apps/mac/1.1/#app43ad802c
If you want users to keep the app’s data stored on their device, make sure the new version uses the same bundle-identifier as the one it’s replacing, and tell users not to delete their old version before installing the new one. The new version will replace the old one and keep data stored on the device, if the bundle-identifiers match.
When running the app from Xcode directly to my connected iPad, I can remove the folder with my resources, run the app again, and the folder remains in the bundle on my iPad.
This behavior is what i look for. I'm planning on adding more folders with new resources with new updates. Since the resources are quite heavy, I don't want users to have to download bigger and bigger archives. I want to add just the new stuff.
The problem arises when I make a new archive without the folder and update the app from my web server as users would. Then the folder seems to be deleted.
Any experience with this?
The bundle that you install is always overwritten by the new bundle that you install. The user data referred to in the documentation is the data stored in the Documents and Library folders of the file system. If you wish to be sure that the old bundle files will always be available, you can copy them from the bundle to the Library/Caches folder of the application.
One thing worth mentioning is that the way to ensure that the ad hoc installation overwrites the current bundle is to make sure that you change the bundle version.
hope this helped :)

How to save data from version to version in iphone app development?

I'm having a problem for my app, a Chinese-English dictionary. I'm now adding a wordbook for it, and try to save the contents of it to a plist every time users exit the app. But now I find that as my app updates, all these data will get lost because the path of the app is changed.
I'm now working for a company so the app will keep releasing new versions, and how can I save the data from version to version?
all these data will get lost because the path of the app is changed.
That would indicate you're writing to your application's directory structure. Don't do that.
The iPhone has a documents directory.
Document Directory discussion

Resources