Search code examples
swiftxcodeskstorereviewcontroller

How to request App Ratings with requestReview() correctly


I am currently learning how to ask the user for an AppStore rating in the app. I have read through numerous documentations and reports from Apple and other bloggers, but I still have questions:

  1. I thought that I want to display my request after the user has completed a sequence of actions 3 times. But if the user doesn't want to rate my app right now, can I ask him to rate my app again later? I also read that Apple controls when and how often the review request is displayed (up to 3x / year)
  2. My app has different functions. Therefore it is not guaranteed that the user accesses exactly this function, where I want to show the rating view. Is it therefore possible to call up the rating request at different points in the app and simply leave it up to Apple whether the rating request is also displayed?

Best regards

Edit for @K bakalov :

enum AppReviewRequest {
    
    @AppStorage("runCountSinceLastRequest") static var runCountSinceLastRequest = 0
    @AppStorage("lastVersion") static var lastVersion = ""
    
    static let threshold = 4
    static let currentVersion = Bundle.main.object(forInfoDictionaryKey: "CFBundleVersion") as! String

    static func countUpRequestReview() {
        if currentVersion != lastVersion {
            if runCountSinceLastRequest < threshold - 1 {
                runCountSinceLastRequest += 1
                print(runCountSinceLastRequest)
            }
        }
    }
    
    static func requestReviewIfNeeded() {
        if currentVersion != lastVersion {
            if runCountSinceLastRequest == threshold {
                if let scene = UIApplication.shared.connectedScenes.first(where: { $0.activationState == .foregroundActive }) as? UIWindowScene {
                    SKStoreReviewController.requestReview(in: scene)
                    
                    lastVersion = currentVersion
                    runCountSinceLastRequest = 0
                }
            }
        }
    }
}

Solution

  • I assume you already read that but if you haven't I am leaving a link for you to check it out: https://developer.apple.com/documentation/storekit/requesting_app_store_reviews

    It contains helpful information and guides when and how to prompt the user to leave a review.

    Back to your questions.

      • Yes, you can ask again for review but there is no guarantee that the Review pop-up (alert) will be presented again. It is usually delayed in time and sometimes requires a new update of the app to trigger a new review prompt; That is correct, Apple has control over it but I don't know if its limited to only 3 times a year.
      • Yes, you can call it as many times as you want and wherever you find it suitable. Although, I highly encourage you to read (if still haven't) the link above. You need to think of a non-intrusive way to ask for review, otherwise you risk the user to dismiss the prompt, even if they like the app.

    Just an advice, many apps use an approach with a custom popup "Do you like the app? Yes/No", if "Yes" then request a review using requestReview() call. And/or as mentioned in the article above, you can always use a manual review by redirecting to the AppStore, if you need it as a result of a CTA (tap on a button for example).