25

Is there a way to open the app store to a specific application? I tried using something like the following:

[[UIApplication sharedApplication] openURL: [NSURL URLWithString:@"http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=284417350&mt=8&uo=6"]];

But got the following: "Safari cannot open the page because to many redirects occurred".

Kyle
  • 17,317
  • 32
  • 140
  • 246

6 Answers6

29

Apparently this issue only affects the simulator. A build an go on the device works perfect.

Chris Kooken
  • 32,730
  • 15
  • 85
  • 123
Kyle
  • 17,317
  • 32
  • 140
  • 246
  • I could imagine myself debugging my whole code not knowing that the problem is from the simulator... This answer seems better. – Mazyod Aug 03 '11 at 20:50
24

Use http://itunes.com/app/YourAppNameWithoutSpaces

See also this.

Community
  • 1
  • 1
MrMage
  • 7,282
  • 2
  • 41
  • 71
  • The same thing happens when the shorter URL is used. – Kyle Oct 04 '09 at 21:24
  • 6
    I tried to be helpful, but you don't motivate people by downvoting a possibly helpful answer! I'll think twice the next time before answering a question of yours. – MrMage Oct 04 '09 at 21:33
  • Sorry to downvote, my intent was not to demotivate, but rather if someone else has this issue and they read this post, it saves them from trying it. – Kyle Oct 04 '09 at 22:55
7

Another simple way is:

[[UIApplication sharedApplication] openURL: [NSURL URLWithString:@"itms-apps://itunes.com/app/YourAppNameWithoutSpaces"]];

This is very clean

Dima Deplov
  • 3,688
  • 7
  • 45
  • 77
5

You can open app without opening safari

NSString *appId = @"you appid"; //like 999999999
NSString *link = [@"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=" stringByAppendingString:appId];

[[UIApplication sharedApplication] openURL: [NSURL URLWithString:link]];
Tim Kozak
  • 4,026
  • 39
  • 44
3

Replace iTunesLink with your App URL.

 NSString *iTunesLink = @"https://itunes.apple.com/us/app/digital-speedometer-pro/id1021728349?mt=8";

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:iTunesLink]];
PRITAM SATPUTE
  • 111
  • 2
  • 5
1

Starting from iOS 6 right way to go is using SKStoreProductViewController class.

Code is here: https://stackoverflow.com/a/32008404/1151916

Community
  • 1
  • 1
Ramis
  • 13,985
  • 7
  • 81
  • 100