Opening App Store in iPhone without Safari
A week or so ago, we were working on a free Brainy Smarty Party Lite version of the game, and bumped into a bit annoying thing. Lite version has a screen, describing full version of the game, and a link, which opens game’s page in App Store. The annoying part is, that after you press a button, instead of opening App Store directly, it actually opens Safari browser, which in turn redirects to a bunch of other URLs, and then launches App Store. Whoa… so much action for such a simple thing! As always, all knowing Google helped to solve the problem. And solution was… erm… interesting.
URL that opens application in App Store is this: http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=326683049&mt=8. Now, to fix the problem, all you have to do is change “itunes” part to “phobos”, so the URL would look like: http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=326683049&mt=8. Sometimes you wish all the problems could be solved like that! Code for opening an app in a webstore is here:
NSString *buyString=@"http://phobos.apple.com/WebObjects/" \ "MZStore.woa/wa/viewSoftware?id=326683049&mt=8"; NSURL *url = [[NSURL alloc] initWithString:buyString]; [[UIApplication sharedApplication] openURL:url]; [url release];
So, the annoying thing was fixed, and BSP Lite is on it’s way to App Store! Hopefully Apple will approve it soon. Fingers crossed.