SKStoreReviewController.requestReview() 在 Live App 中不工作

SKStoreReviewController.requestReview() not working in Live App

这是我请求审核的代码:

        if #available(iOS 10.3, *) {
            SKStoreReviewController.requestReview()
        }
        else{
            print("Review is not available with in the app")
        }

在开发模式下它工作正常并且我能够像这样获得 PopUp: 但是在从 Appstore 下载的 Live 应用程序中,应用程序不会显示此评级弹出窗口,如果用户点击评级按钮,则不会发生任何事情。

来自documentation

Although you should call this method when it makes sense in the user experience flow of your app, the actual display of a rating/review request view is governed by App Store policy. Because this method may or may not present an alert, it's not appropriate to call it in response to a button tap or other user action.

(突出显示我的)

如果你有一个像你在问题中所说的评级按钮,你不应该期望它显示提示。

只有在以下情况下才会出现提示:

  1. 用户没有在设置中禁用审阅提示。
  2. 该提示在一年内向用户显示 3 次或更少。

如果您必须在用户互动时请求审核,您必须将用户引导至您应用的 App Store 页面,使用如下代码(取自 Requesting App Store Reviews Sample Code):

@IBAction func requestReviewManually() {
    // Note: Replace the XXXXXXXXXX below with the App Store ID for your app
    // You can find the App Store ID in your app's product URL
    guard let writeReviewURL = URL(string: "https://itunes.apple.com/app/idXXXXXXXXXX?action=write-review")
    else { fatalError("Expected a valid URL") }
    UIApplication.shared.open(writeReviewURL, options: [:], completionHandler: nil)
}