3

I am using this code to prompt a rate us in my app:

if #available(iOS 10.3, *) {
    SKStoreReviewController.requestReview()

} else if let url = URL(string: "itms-apps://itunes.apple.com/app/" + "MyIdHere") {
    if #available(iOS 10, *) {
        UIApplication.shared.open(url, options: [:], completionHandler: nil)

    } else {
        UIApplication.shared.openURL(url)
    }
}

On the simulator, the rate prompt comes up as planned, but I i run it using testflight, the rate does not come up at all. Any tips?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Camile
  • 155
  • 3
  • 10
  • 2
    Please read the documentation for `SKStoreReviewController`. It doesn't appear every time you call it, except in development. – rmaddy Sep 10 '19 at 19:59
  • @rmaddy But how can I then test it? – Camile Sep 10 '19 at 20:00
  • 1
    Does it appear properly in development? Then it will appear, when Apple deems it should, in Test Flight and from the App Store. – rmaddy Sep 10 '19 at 20:01
  • @rmaddy It does appear when running on simulator, but it does not appear in TestFlight. – Camile Sep 10 '19 at 20:05
  • 2
    Running on the simulator is development. Using TestFlight is production. – rmaddy Sep 10 '19 at 20:06
  • @rmaddy Ah, ok! Thanks – Camile Sep 10 '19 at 20:23
  • @Camile Covered this in detail here: https://stackoverflow.com/questions/45057452/why-the-skstorereviewcontroller-does-not-let-me-submit-a-review/45061556#45061556 – CodeBender Sep 10 '19 at 20:31
  • @rmaddy Apple already accepted my new update, so the new app version is out in AppStore. When I try to prompt the rate popup, it doesn't pop up at all on my phone? Any ideas? – Camile Sep 11 '19 at 16:30
  • It's the same thing. The review screen isn't shown every time you ask for it. Again, read the documentation for SKStoreReviewController and the requestReview method. – rmaddy Sep 11 '19 at 16:32

1 Answers1

1

As per Apple's documentation this API has no effect in testflight and you should never link this API to any user action because Apple reserves the right to show or not the prompt even when you call this API, also the prompt will only be displayed to a user a maximum of three times within a 365-day period

Note

When you call this method while your app is in development mode, a rating and review request view is always displayed so you can test the user interface and experience. However, this method has no effect when you call it in an app that you distribute using TestFlight.

If you need to call manually on any user action please use the code below:

@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://apps.apple.com/app/idXXXXXXXXXX?action=write-review")
        else { fatalError("Expected a valid URL") }
    UIApplication.shared.open(writeReviewURL, options: [:], completionHandler: nil)
}

Please find more details about the API here: https://developer.apple.com/documentation/storekit/skstorereviewcontroller/3566727-requestreview

and also the best practice for using it here: https://developer.apple.com/documentation/storekit/requesting_app_store_reviews

Mohammed Shakeer
  • 1,446
  • 16
  • 23
  • 1
    April 2023 and i can validate that this is the case. You can check it on the simulator but not in the app distributed via Testflight. Which makes a lot of sense. – christostsang Apr 22 '23 at 09:35