I have an application that after a button click sends the client to the AppStore in order to download an new app. This is done with the following code:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"itms-apps://ax.itunes.apple.com/app/yyy-mobile/id4xxxxx89"]];
This line of code worked fine until iOS6, but after the latest v7 iOS SDK the code broke.
How do we resolve the issue? Do we need an if/else logic checking if the device has iOS 7 installed? For example:
if( iOS < 7 ) { // keep old logic
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"itms-apps://ax.itunes.apple.com/app/yyy-mobile/id4xxxxx89"]]; }
else // new logic for iOS 7
//TBD
}
Or it would be better to replace the old line with new code that does the job for iOS7 and iOS6 (ie, a new method that is backwards compatible)?