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

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.

Related

How to update metadata easily Apple App Store?

When I create a new version for the App Store (because I want to change the keywords and metadata for ASO purposes), most things are gone such as the app icon etc. How do I copy over the missing metadata from the old version?
Also, is there a way to create a new version of the app just to improve ASO, without uploading a new build?
Thanks.
You can create a complete backup of your app store metadata.
With the following tool you can create an export.
- You will receive an ZIP file by email with all your metadata
- Then you can edit the files locally or just import all the data whenever you need it
Scroll down on the following page to find the tool:
https://www.iwantanelephant.com/app-store-export-import/

Updating iPhone app removed the older version data

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

When Apple app association file downloaded to iOS device

We have deployed the app-association file to production server. Now I would like to add a new path to app-association file. So my question is whether new app-association file will get dowloaded to user device when new app is installed or app update?
OR will it get updated in user device immediately when app-association file is updated in server?
Appreciate your help
The apple-app-site-association file is pulled when the app is first downloaded, and whenever an update is downloaded from the App Store. So basically you'll need to release a new version of the app before all your existing users see the new path.

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.

Getting to know if my app is updated from app store

I am going to publish a new version of my app on app store. I just want to know that if the app is being updated from the previous version or user has installed a fresh copy of the new version of my app. Based on this information i want to show some information to the updated users.
I was thinking of to keep a key in my NSUserDefaults of the previous_version but i haven't added any such key in the NSUserDefaults of my previous app version. So this key will be nil in both cases in my new version.
Is there a way i can get to know if the user has updated the app or installed a fresh copy of my app.
There is no direct way for it. Indirectly you can check it. If you are moving your editable data into Documents directory in your previous version then at the time of launching new application, you can check if the file is present in document directory. If you can find it, the application is opened after update and if file is not present then it has been opened because of a fresh installation.

Resources