SKStoreReviewController — Apple way to request review and rating inside iOS app in ios 10.3 and higher

Kavitha Kumarasamy
3 min readMar 1, 2018

--

Screenshots from my sample project kReviewMe

Every app developer’s aim is to get feedback or review for their app to get better exposure and encourage others to use their apps. Usually, the developer presents a custom review UIView with star images in UIStackview on to their app. Then, the user ratings are recorded in the backend but when it comes to app store review, the user generally says “Not now” option because the user will be taken out from the current app’s screen to Apple App store page.

Do we miss feedback from the user because of this behavior?

Apple has introduced ‘SKStoreReviewController’, which presents a review UIView on your app screen, from which ratings and reviews are recorded. There is no need for any user to navigate to Apple app store for submitting his/her review. Cool. Isn’t it?

The three simple steps are:

  1. import StoreKit.
  2. Check if versions are 10.3 and above.
    if #available(iOS 10.3, *) {
    //call ios API method for review view.
    } else {
    //Use your custom review view.
    }
  3. Call SKStoreReviewController.requestReview() from your view controller.
    if #available(iOS 10.3, *) {
    SKStoreReviewController.requestReview()
    } else {
    //Use your custom review view.
    }

Tada!

You will be presented with a review view and stars for rating the app.
Great, but we have to be aware of certain points while implementing ‘SKStoreReviewController’ view.

Those are:

  1. You should only call request review when it makes sense in the user experience flow of your app, and then call the method only after the user has demonstrated some engagements on an app.
  2. You have no control over exactly what’s happening and the dialog displayed or its callbacks, that is determined entirely by the system.
  3. The system may or may not show a rating prompt, it’s not appropriate to call the API in response to a button tap or other user action because it is not going to happen every time.
  4. No matter how many times you call the API, the system will only show up to a maximum of 3 prompts to the same user in a 365-day period.
  5. The App Store defaults to showing ratings and reviews only for your app’s most recent version.
  6. The User can turn off this in settings.
  7. Apple might mandate this flow in future.

Apple’s reference link: https://developer.apple.com/documentation/storekit/skstorereviewcontroller

A better way to write ‘SKStoreReviewController’ from my perspective would be:

  1. Writing a separate class for all ‘SKStoreReviewController’ related checks, imports, and methods.

import StoreKit
class kReviewMe {
//All logic and method calls.
}

2. My logic on showing review view is based on no of launches of the app made by any user. The launch count will be stored in NSUserDefaults.

/** UserDefauls dictionary key where we store the number of launching the app. **/
let launchCountUserDefaultsKey = “noOfLaunches”

3. To decide whether review view to be shown or not.

/** Get UserDefaults value if its nil or no value found, set the value and there on increment ‘launchCount’ on every launch. **/

func isReviewViewToBeDisplayed(minimumLaunchCount:Int) -> Bool {
let launchCount = UserDefaults.standard.integer(forKey: launchCountUserDefaultsKey)
if launchCount >= minimumLaunchCount {
return true
} else {
/** Increase launch count by ‘1’ after every launch.**/
UserDefaults.standard.set((launchCount + 1), forKey: launchCountUserDefaultsKey)
}
return false
}

4. To call ‘showReviewView’ method from any viewcontroller of the app.

/** This method is called from any class with minimum launch count needed. **/
func showReviewView(afterMinimumLaunchCount:Int){
if(self.isReviewViewToBeDisplayed(minimumLaunchCount: afterMinimumLaunchCount)){
SKStoreReviewController.requestReview()
}
}

5. Now you can call ‘’showReviewView’ like this:

/** call ‘showReviewView’ method with desired launch counts needed. **/
if #available(iOS 10.3, *) {
kReviewMe().showReviewView(afterMinimumLaunchCount: 2)
}else{
// Review View is unavailable for lower versions. Please use your custom view.
}

minimum launch count is Int value which we decide on the number of launch counts.
The link to an example project: https://github.com/kavitha89/kReviewMe.git

--

--

Kavitha Kumarasamy

iOS freak | mobile developer | front end developer | Reactjs | React-Native | dancer | A Mother | Marvel fan | Cyclist | Table Tennis enthusiast | a learner.