打开App Store以从我的应用程序中评分

时间:2011-09-21 11:19:00

标签: iphone objective-c xcode app-store

我想知道是否可以从我的应用中将我的用户直接带到应用商店应用的评论部分?

我不想在Safari中打开它,我希望它直接打开设备上的App Store应用程序并将它们带到评论页面。

我尝试了以下内容;

[[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"]];

然而,点击它似乎打开iTunes应用程序而不是应用程序商店,然后只是出现错误“无法连接到商店。无法建立安全连接”。

有什么想法吗?

6 个答案:

答案 0 :(得分:23)

在iOS 7.0中似乎有一个值得一提的问题,如here所述。您可以看到Appirator如何在源here中处理问题。

基本上,您需要以不同方式处理7.0用户,因为:(第一行与接受的解决方案相同,附加的字符串只在同一行。)

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]];

2015年8月19日更新

上述网址不适用于iOS 8.0。适用于所有iOS版本的更新代码将是:

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]];

来源:Appirator


2017年11月14日更新

从iOS 10.3开始,我们可以使用SKStoreReviewController请求审核,这实际上会在您的应用中打开一个简洁的小插页,而不是导航离开您的应用:

if (@available(iOS 10.3, *)) {
  [SKStoreReviewController requestReview];
  return;
}

答案 1 :(得分:18)

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]];
}

答案 2 :(得分:4)

您想要一个itms://链接,here's可以生成一个方便的地方。请务必将协议从http(s):更改为itms:(或itms-apps:,这似乎是新的方式。)

答案 3 :(得分:1)

你可以使用课程iRate,对我来说效果很好。

答案 4 :(得分:1)

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

答案 5 :(得分:0)

使用它也可以帮到你。

  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

相关问题