- (void)openWithLink:(NSString *)urlLink
{
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlLink]];
}
Call the method:
[self openWithLink:@"THE_LINK"];
Replaces THE_LINK with the actual link, which can take a number of forms:
1. (Link directly to the app - method 1) http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=YOUR_APP_ID e.g. http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=498871441
2. (Link directly to the app - method 2) http://itunes.apple.com/app/idYOUR_APP_ID
e.g. http://itunes.apple.com/app/id488561581
3. (Link directly to the app - method 3) http://itunes.com/apps/YOUR_APP_NAME
e.g. http://itunes.com/apps/memorable
4. (Link to your company) http://itunes.com/apps/YOUR_COMPANY_NAME
e.g. http://itunes.com/apps/absoluterippleptyltd
5. (Link to the rating page of your app)
NSString *str = @"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa";
str = [NSString stringWithFormat:@"%@/wa/viewContentsUserReviews?", str];
str = [NSString stringWithFormat:@"%@+Software&id=", str];
//- replace the following with your app id from iTunes Connect
str = [NSString stringWithFormat:@"%@YOUR_APP_ID", str];
One point to note about all these url scheme is that they can (and do) change. You must test the link out inside your app to make sure it is working.
Optional:
You can replace 'http' with 'items-apps'. e.g. itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=498871441
This will supposedly open the App Store app directly, whereas the 'http' will first invoke Safari and then redirect to the App Store app. In practice, this doesn't seem to happen all the time.
See: Technical Q&A QA1633 Creating easy-to-read links to the App Store for your applications and company