7

I was wondering if it is possible to take my user directly to the review section of my app on the app store from within my app?

I don't want this to open in Safari, I want it to directly open the App Store app on the device and take them to the review page.

I have tried the following;

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=437688779&onlyLatestVersion=true&pageNumber=0&sortOrdering=1&type=Purple+Software"]];

However, clicking that seems to open up the iTunes app and not app store and then just gives an error saying "Cannot Connect to the store. A secure connection could not be established".

Any ideas?

Paul Morris
  • 1,763
  • 10
  • 33
  • 47

6 Answers6

24

There seems to be an issue worth mentioning in iOS 7.0 as described here. You can see how Appirator dealt with the problem in their source here.

Basically, you need to handle 7.0 users differently, as so: (the first line is the same as the accepted solution, the appended strings are just on the same line.)

NSString *str = @"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=yourAppIDHere";
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) {
    str = @"itms-apps://itunes.apple.com/app/idyourAppIDHere";
}
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];

Update 19 August 2015

The URLs above don't work for iOS 8.0. Updated code catering for all iOS versions would be:

NSString *str;
float ver = [[[UIDevice currentDevice] systemVersion] floatValue];
if (ver >= 7.0 && ver < 7.1) {
    str = [NSString stringWithFormat:@"itms-apps://itunes.apple.com/app/id%@",appID];
} else if (ver >= 8.0) {
    str = [NSString stringWithFormat:@"itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=%@&onlyLatestVersion=true&pageNumber=0&sortOrdering=1&type=Purple+Software",appID];
} else {
    str = [NSString stringWithFormat:@"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=%@",appID];
}
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];

Source: Appirator


Update 14 November 2017

From iOS 10.3, we can request a review using the SKStoreReviewController, which actually opens a neat little popover in your app rather than navigating away from your app:

if (@available(iOS 10.3, *)) {
  [SKStoreReviewController requestReview];
  return;
}
Craig Grummitt
  • 2,945
  • 1
  • 22
  • 34
18

As seen in this blog:

- (IBAction)gotoReviews:(id)sender
{
    NSString *str = @"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa";
    str = [NSString stringWithFormat:@"%@/wa/viewContentsUserReviews?", str]; 
    str = [NSString stringWithFormat:@"%@type=Purple+Software&id=", str];

    // Here is the app id from itunesconnect
    str = [NSString stringWithFormat:@"%@yourAppIDHere", str]; 

    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
}
Dan Hanly
  • 7,829
  • 13
  • 73
  • 134
Youssef
  • 3,582
  • 1
  • 21
  • 28
  • Don't use -[NSString stringWithFormat:] when you're just appending string. -[NSString stringByAppendingString:] will do just the same, but much faster and efficiently (no buffers, etc.). – Charlie Monroe Feb 25 '14 at 16:33
  • You can skip the "type=..." part so that the url reads ".../viewContentsUserReviews?id=...". This works for iOS 7.1.2 as well as 8.0.2 (tested on real devices). – Richard R Oct 13 '14 at 08:16
4

You want an itms:// link, and here's a handy place to generate one. Make sure you change the protocol from http(s): to itms: (or itms-apps: which seems to be the new way).

Pål Brattberg
  • 4,568
  • 29
  • 40
1

You can just use the class iRate, did work well for me.

andrewsi
  • 10,807
  • 132
  • 35
  • 51
Frank
  • 16,476
  • 7
  • 38
  • 51
0

Use this:- @"itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=%@";

codercat
  • 22,873
  • 9
  • 61
  • 85
0

use this its also help you.

  NSString *fdAppUrl=@"itms://itunes.apple.com/us/app/apple-store/id1137341185?mt=8";

 [[UIApplication sharedApplication] openURL:[NSURL URLWithString:fdAppUrl]];

http://stackoverflow.com/questions/433907/how-to-link-to-apps-on-the-app-store

Anup Gupta
  • 1,993
  • 2
  • 25
  • 40