user409333
user409333

Reputation:

Open app store from code

In some free apps there is a button for buy pro version of app that if you touch it app store app will open how can i do that from code ?

Upvotes: 1

Views: 3501

Answers (3)

timothy5216
timothy5216

Reputation: 281

The iPhone/iPad will automatically recognize an AppStore URL if you just:

- (IBAction)OpenAppInAppStore {

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"itms://itunes.apple.com/us/app/wolframalpha/id334989259?mt=8"]];

}

or if you open any URL that has "itms://" and only on the device

Upvotes: 8

Matthias Bauch
Matthias Bauch

Reputation: 90117

  1. Launch iTunes on your computer.
  2. Search for the item you want to link to.
  3. Right-click or control-click on the item's name in iTunes, then choose "Copy iTunes Store URL" from the pop-up menu.
  4. Open the modified URL using an NSURL object and the -[UIApplication openURL] method.

Read Technical Q&A QA1629. They also offer a method how you can add your iTunes Affiliate link without redirecting from your app to safari to the appstore

Upvotes: 7

TheSquad
TheSquad

Reputation: 7506

Use the function openURL from UIApplication with the iTunes URL link of your App.

Upvotes: 1

Related Questions