Search code examples
iosswiftskstorereviewcontroller

SKStoreReviewController.requestReview() not working in Live App


This is my code for Requesting Review :

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

In Development Mode it is working properly & I am able to get PopUp like this: But In Live app downloaded from appstore, App isnot showing this ratings Popup and nothing happens if user taps out on Ratings Button.

enter image description here


Solution

  • From the 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.

    (Highlight mine)

    If you have a Ratings Button like you said in your question, you should not expect it to show the prompt.

    The prompt will only show up if:

    1. The user hasn't disabled Review Prompts in Settings.
    2. The prompt has been shown to the user 3 times or less in a year.

    If you must request a review upon user interaction, you must direct your users to the App Store page of your app instead, using code like this (taken from 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)
    }