0

There is a situation that I am faced with which seems like it has no solution. Here it is: I have an app on App Store. I didn't write any piece of code for this app keeping the upgrade scenario in mind. For all I could imagine, I never that I would be giving out more versions apart from the one I already have on app store. Now, the situation is that I am required to give an upgrade of my app and with in the new code, I am to identify if it is a new install of the latest version or if it is an upgrade from the older version. I don't know how to approach this as I have not coded my first version appropriately for upgrades? Anybody willing to enlighten me.

  • Does the existing app write any data to `NSUserDefaults` or any other on-device storage? – jnic Apr 01 '11 at 10:46
  • no and that is the problem . I never wrote anything to NSUserDefaults –  Apr 01 '11 at 10:49
  • How about any cached data? Is anything persisted at all? Any local database? – André Morujão Apr 01 '11 at 10:53
  • Duplicate of http://stackoverflow.com/questions/5509459/distinguishing-between-iphone-app-upgrade-and-app-new-install/5509504#5509504. Dont ask the same question twice – visakh7 Apr 01 '11 at 11:05
  • no db also. But I think I sorted this one out courtesy some variable. But this brings up another question. Now that this issue is sorted, how do I ensure that this doesn't happen from now on and I am able to identify if the user upgrades from version1 -> version 3 or version 1 -> version 2 or version 2 -> version 3 or direct install of version 3 and similarly with version 4 onwards. –  Apr 01 '11 at 11:05
  • @7kV7 You should learn to understand the question properly before rushing towards posting an answer and advising me not to post the same question twice. –  Apr 01 '11 at 11:33

1 Answers1

0

See previous thread here iPhone: How do I detect when an app is launched for the first time? I use this in just your scenario and it's fine to introduce it with the update - it copes with the previous version doing none of this.

Community
  • 1
  • 1
Roger
  • 15,793
  • 4
  • 51
  • 73