使用 SKStoreProductViewController 或 SKStoreReviewController 进行应用评级/评论?

Use SKStoreProductViewController or SKStoreReviewController for app rating / review?

关于 SO 的文章很多,SKStoreProductViewController 禁用了 "Write a review" 按钮。然而,所有这些 SO 文章都已有多年历史,SKStoreProductViewController 的苹果文档并未提及该限制。

在 iOS 9.3.2 中测试时,按钮没有显示为禁用状态,而是在点击它时没有任何反应,这不仅让开发人员感到困惑,而且让用户感到困惑,这似乎是不对的。

那么 iOS 9

是真的吗

更新 iOS 10.3+

已接受的答案解释了 SKStoreProductViewControllerSKStoreReviewController 在应用评级/评论中的区别。原题是在引入SKStoreReviewController.

之前写的

显然 SKStoreProductViewController 仅用于在 App Store 上购买应用程序,而不用于审查产品。这可以从Apple docs:

中隐含地理解

A SKStoreProductViewController object presents a store that allows the user to purchase other media from the App Store. For example, your app might display the store to allow the user to purchase another app.

只要此限制存在,唯一的解决方法就是深度链接到 App Store 应用程序,例如

let url = NSURLComponents(string: "itms-apps://itunes.apple.com/app/id\(yourAppleAppId)")!
UIApplication.sharedApplication().openURL(url)

更新 iOS 10.3+

SKStoreReviewController 允许用户直接在应用程序内通过对话框对应用程序进行评分。唯一的缺点是您只能请求 StoreKit 显示对话框,但不能确定它是否会显示。

Tells StoreKit to ask the user to rate or review your app, if appropriate.

请注意,随着 SKStoreReviewController 的推出,Apple 可能会在不久的将来禁止自定义应用评级和评论提示。应用审查指南规定:

Use the provided API to prompt users to review your app; this functionality allows customers to provide an App Store rating and review without the inconvenience of leaving your app, and we will disallow custom review prompts.

目前的一个缺点,也可能是仍然允许自定义评论提示的原因,是 Apple 尚未提供 API 来获取评论指标和 post 对书面评论的回应。 iTunes Connect 当前唯一的解决方案,对于客户服务环境中的大规模和性能要求不实用。

你要找的是

import StoreKit

func someFunction() {
 SKStoreReviewController.requestReview()
}

但它刚刚与 10.3 一起发布,因此您仍然需要一些如上所述的旧版本的回退方法