美文网首页iOS常用
iOS 评分的三种方式

iOS 评分的三种方式

作者: sergeant | 来源:发表于2020-09-10 10:20 被阅读0次

方式一:deep link

在 APP 地址的后面拼接参数 action=write-review 跳转到 APP Store 评论页进行评价。

NSString *str = [NSString stringWithFormat:@"itms-apps://itunes.apple.com/app/id%@?action=write-review", kAPPID];
NSURL *url = [NSURL URLWithString:str];
if ([UIApplication.sharedApplication canOpenURL:url]) {
    [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:NULL];
}

跳转后的页面:

IMG_7BDFB00DC5E3-1.jpeg

方式二:SKStoreProductViewController

使用 SKStoreProductViewController 打开产品页进行评论。

SKStoreProductViewController *storeProductViewController = [[SKStoreProductViewController alloc] init];
storeProductViewController.delegate = self;
[storeProductViewController loadProductWithParameters:@{SKStoreProductParameterITunesItemIdentifier: kAPPID} completionBlock:^(BOOL result, NSError * _Nullable error) {
    if (error) {
        
    } else {
        [self presentViewController:storeProductViewController animated:YES completion:nil];
    }
}];

还需要实现 SKStoreProductViewControllerDelegate

- (void)productViewControllerDidFinish:(SKStoreProductViewController *)viewController {
    [viewController dismissViewControllerAnimated:YES completion:nil];
}

这种方式评分没问题:

WechatIMG1.jpeg

但是撰写评论时顶部的按钮会被遮住,影响操作(iPhone 6, iOS 12.4.8):

WechatIMG2.jpeg

方式三:SKStoreReviewController

SKStoreReviewController 是在 iOS 10.3 才推出的新评分方式。

[SKStoreReviewController requestReview];
WechatIMG5.jpeg

使用有以下限制:

  • 系统版本不低于 iOS 10.3
  • 只能评分,不能撰写评论
  • debug模式下可以无限次弹出,但是不能点提交按钮
  • TestFlight测试时不会弹出
  • App Store 正式版同一用户一年最多允许弹出三次

基于以上限制,该方式不适合让用户点击后弹出。我们需要在满足一定的条件下,自动弹出。比如用户第3次打开当前版本。

参考链接:https://www.jianshu.com/p/561fc08bbf79

相关文章

网友评论

    本文标题:iOS 评分的三种方式

    本文链接:https://www.haomeiwen.com/subject/dnmeektx.html