我想把一个“率/审查这个应用程序”功能到我的应用程序。

是否存在一种方法能够直接链接到应用商店中他们评论应用的屏幕?所以用户不需要点击主应用程序链接。谢谢。

编辑:由于缺乏回应,开始赏金。为了确保这一点非常清楚:我知道我可以链接到应用商店中我的应用页面,并让用户从那里点击到“审查这款应用”屏幕。问题是是否有可能直接链接到“审查这个应用程序”屏幕,这样他们就不需要点击任何东西。


当前回答

let rateUrl = "itms-apps://itunes.apple.com/app/idYOUR_APP_ID?action=write-review"
if UIApplication.shared.canOpenURL(rateUrl) {
    UIApplication.shared.openURL(rateUrl)
}

其他回答

以上方法都是正确的,但是现在使用SKStoreProductViewController可以带来更好的用户体验。要使用它,你需要做以下工作:

implement SKStoreProductViewControllerDelegate protocol in your app delegate add required productViewControllerDidFinish method: - (void)productViewControllerDidFinish:(SKStoreProductViewController *)viewController { [viewController dismissViewControllerAnimated: YES completion: nil]; } Check if SKStoreProductViewController class is available and either show it or switch to the App Store: extern NSString* cAppleID; // must be defined somewhere... if ([SKStoreProductViewController class] != nil) { SKStoreProductViewController* skpvc = [[SKStoreProductViewController new] autorelease]; skpvc.delegate = self; NSDictionary* dict = [NSDictionary dictionaryWithObject: cAppleID forKey: SKStoreProductParameterITunesItemIdentifier]; [skpvc loadProductWithParameters: dict completionBlock: nil]; [[self _viewController] presentViewController: skpvc animated: YES completion: nil]; } else { static NSString* const iOS7AppStoreURLFormat = @"itms-apps://itunes.apple.com/app/id%@"; static NSString* const iOSAppStoreURLFormat = @"itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=%@"; NSString* url = [[NSString alloc] initWithFormat: ([[UIDevice currentDevice].systemVersion floatValue] >= 7.0f) ? iOS7AppStoreURLFormat : iOSAppStoreURLFormat, cAppleID]; [[UIApplication sharedApplication] openURL: [NSURL URLWithString: url]]; }

知道你的苹果应用程序id,它是你的itunes应用程序url后id字段的数字。

比如:https://itunes.apple.com/app/id148688859, 148688859是你的应用id。

然后,使用正确的应用程序id重定向到此url: https://itunes.apple.com/app/idYOUR_APP_ID?action=write-review。

上面写的一切都是正确的。这只是一个插入到应用中的示例,并将{YOUR app ID}更改为实际的应用ID,从iTunesconnect中获取,以显示评论页面。请注意,正如上面所评论的,它不能在模拟器上工作-只是在设备上。

修正,因为iOS 7的变化。 修正iOS 10+ openURL更改 对于iOS 13.6+的审查URL是可以访问的,在版本6.0之前使用。它直接开到评论页面。代码更新

    NSString * appId = @"{YOUR APP ID}";
    NSString * theUrl = [NSString  stringWithFormat:@"itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=%@&onlyLatestVersion=true&pageNumber=0&sortOrdering=1&type=Purple+Software",appId];
    int vers = (int) [[UIDevice currentDevice].systemVersion integerValue];
    if (vers > 6 && vers < 12 ) theUrl = [NSString stringWithFormat:@"itms-apps://itunes.apple.com/app/id%@",appId];
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:theUrl] options:@{} completionHandler:nil];

Swift 5在iOS14中测试

打开5颗星的回顾窗口

private func openReviewInAppStore() {
    let rateUrl = "itms-apps://itunes.apple.com/app/idYOURAPPID?action=write-review"
    if UIApplication.shared.canOpenURL(URL.init(string: rateUrl)!) {
        UIApplication.shared.open(URL.init(string: rateUrl)!, options: [:], completionHandler: nil)
    }
}
let rateUrl = "itms-apps://itunes.apple.com/app/idYOUR_APP_ID?action=write-review"
if UIApplication.shared.canOpenURL(rateUrl) {
    UIApplication.shared.openURL(rateUrl)
}