3

I have couple of applications alive in Apple store and we have just released updated version of these applications with incremented version numbers. I found that all resources are getting updated correctly(updated splash screen, background image etc) but newly added features are not getting updated. For example, I have included a feature so that iPhone app takes new contents from my website. It doesn't happen when I update the application from Appstore updates list.

...but the other strange thing is if I delete the application from my iPhone and download it again from Apple store then everything works fine!! I am not able to understand what has been going on. Anyone could please help me to debug this?

From this I got following code and added in my AppDelegate. For me it always print Version (null). I could see version number correctly set in my Application-info.plist file though!

#if DDEBUG // debugging/testing
NSString *versionString = [NSString stringWithFormat:@"v%@",[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]];
#else
NSString *versionString = [NSString stringWithFormat:@"Version %@",[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"]];
#endif // DDEBUG
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setValue:versionString forKey:@"version"];
printf("Version: = %s\n", [versionString cStringUsingEncoding:NSMacOSRomanStringEncoding]);
[defaults synchronize]; // force immediate saving of defaults.

Following code works though! I mean it prints the correct version available in application-info.plist file! Got it from here

NSString *version = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"];
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSLog(@"Version: %@", version);
[defaults setObject:version forKey:@"version_preference"];
[defaults synchronize];

I can confirm if this fixes the issue after resubmitting the application.

Thanks.

Community
  • 1
  • 1
Paresh Masani
  • 7,474
  • 12
  • 73
  • 139
  • It may be possible that the binary you had on device was the one you had downloaded from xcode and not downloaded from app-store. – Praveen S Aug 08 '11 at 14:02
  • nope...its been happening on users phone where I don't run xcode at all! – Paresh Masani Aug 08 '11 at 14:05
  • Hi Praveen, do you think http://stackoverflow.com/questions/1311405/iphone-update-application-version-in-settings might be an issue? We update version number in application setting plist file. – Paresh Masani Aug 08 '11 at 14:22
  • AppleDeveloper Can you print the values and check. I have updated 4 of my apps 6 times and never faced such issue. Usually a update is new download with retaining the user details. – Praveen S Aug 08 '11 at 14:29
  • Hi Praveen, please see edited question. Not sure what's going on! It always prints Version (null) for me! Moreover, what is Root.plist? I don't have it my application! – Paresh Masani Aug 19 '11 at 08:59
  • You need to set the plist file name in your application settings. – Praveen S Aug 19 '11 at 11:28

1 Answers1

0

This worked:

NSString *version = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"];
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSLog(@"Version: %@", version);
[defaults setObject:version forKey:@"version_preference"];
[defaults synchronize];
Paresh Masani
  • 7,474
  • 12
  • 73
  • 139