iPhone app Update Vs new version

12,076

Solution 1

I have just discovered something about version upgrades and the App Store. Just now, I'm suffering issues and users crashes because of a behavior of iOS system that I can't figure before. And, very important, iTunes, AppStore and iOS have modified some upgrading and installing rules in last versions. Now, it works this way: - When user install a new version, all the files in the bundle are downloaded and copied in the previous existing bundle, but OLD FILES OR COMPONENTS ARE NOT DELETED (or not all are deleted). So, the final bundle IS NOT equal to the bundle of a fresh installation of the new version. - For example, if a xib/nib file is localized to different languages for the new version, the updated bundle will include both versions: the one in the root folder and the other one in each localized folder. The system, obviously, will use the first one and only a fresh installation will show localizations for that file. One of my apps shows that issue with MainWindow.xib and as there are some modifications in references and classes, the updated apps crash each time you try to run as it is using a obsolet object. I have built a new version changing the name of the xib/nib files that have been localized. As MainWindow is one of them, I have to modify the reference in info.plist of course.

OK, knowing that, you can build a new version with complete different components in the bundle that, if files of previous version does exist, the app then offers the user the option of using them. That is, two versions of the app in a single icon and bundle. Not very difficult to do.

BUT, the very weird thing is that I think that new iOS version and iTunes don't allow downgrades. I have tried to do it but didn't get it done. That is, if you install a version, for example 1.2, it is impossible AFAIK to install latter v1.1 on the device nor in iTunes->"Applications". So, the double version bundle will live until a reinstallation of the app.

Solution 2

You need to create a new version number, which makes sense since this is a new version of your app. This will then appear as an update for your customers. I don't think you can upload a new binary with the same version without removing the old one from the store.

You add a new version in iTunes connect, then update the version number in Xcode to match and create a new archive. It's pretty straightforward.

Solution 3

You must always increase the version number of any update to your app.

Users will see a badge on the App Store icon on the device, and in iTunes on their PC. Going into the updates section, it will list your app along with the list of changes you've provided, and a button to install the update. They can also update all apps at once.

Solution 4

NSString *version = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"];
NSLog(@"version is%@",version);
Share:
12,076
copenndthagen
Author by

copenndthagen

Buy some cool JavaScript related merchandise from; https://teespring.com/stores/technical-guru-2

Updated on June 04, 2022

Comments

  • copenndthagen
    copenndthagen almost 2 years

    Let's say I have an existing IOS app live on Appstore which is version 1.0

    Now I make some changes to the app and want to submit back.

    Are there 2 separate ways to submit ? Like can I still keep the version as 1.0 and just submit the app OR I need to create a new version 1.1 and then submit it ?

    What are the differences in the process?

    Also from the customer end, how does this work for new/existing users ?

  • Lalit Paliwal
    Lalit Paliwal almost 12 years
    very informative answer Gaberiel :) Could you please let me know the sqlite part? What exactly happened if old and new version having same named sqlite file (say abc.sqlite1.0)? How my app new version will behave? will it override old sqlite ? Or I'll get data from both the sqlite.
  • Gabriel
    Gabriel almost 12 years
    Yes. All that I have said is about items in app bundle. If they both have the same name in bundle, then the old one is replaced by the new as expected.
  • Mrunal
    Mrunal over 10 years
    @Gabriel: Is there any way to copy data from older db to newer one, before it gets replaced?
  • Gabriel
    Gabriel over 10 years
    @Mrunal, sorry for the delay. I think the way is not replacing your older db but creating a new one. If the file has the same name in the same folder in the bundle it will be replaced at upgrade.
  • IgniteCoders
    IgniteCoders about 10 years
    About which versions are you talking about? Because i only had to deal with database and other files like terms and condition. I solved that by saving a DB_VERSION constant that i can store in the shared preferences ([NSUserDefaults standardUserDefaults]) and evaluate it to know if i should replace my files.
  • IgniteCoders
    IgniteCoders about 10 years
    You can use [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"] to can handle versions changes as database or new/deprecated keys in shared preferences ([NSUserDefaults standardUserDefaults]). Here is the example: stackoverflow.com/a/23082595/2835520
  • Gabriel
    Gabriel about 10 years
    @MansApps I don't remember the version I found that issue in. The date of the post is Dec 11 '11. Go figure. I had troubles with that because some files that weren't localized in the previous version did exist in the bundle's root folder while new versions where in localized folders. So, the old one was used when invoked crashing the app.
  • IgniteCoders
    IgniteCoders about 10 years
    @Gabriel thanks for the answer, I will take care with that when I add new localizations to my project.