https://developer.apple.com/library/ios/qa/qa1629/_index.html
Q: How do I launch the App Store from my iPhone application? Also, how do I link to my application on the store?
A: The -[UIApplication openURL:]
method handles links to applications and media by launching the appropriate store application for the passed NSURL
object. Follow the steps below to obtain a link to an application, song, or album sold on iTunes, and link to it from your iPhone application:
-
Launch iTunes on your computer.
-
Search for the item you want to link to.
-
Right-click or control-click on the item's name in iTunes, then choose "Copy iTunes Store URL" from the pop-up menu.
-
Open the modified URL using an
NSURL
object and the-[UIApplication openURL:]
method.
See Listing 1 for an example that launches the App Store from a native application.
Launching the App Store from an iPhone application.
NSString *iTunesLink = @"http://itunes.apple.com/us/app/id284417350?mt=8"; |
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:iTunesLink]]; |