Requesting Reviews in iOS 14 Apps

October 7, 2020

Getting reviews for you app is extremely important for the long term success, but it is not something that you necessarily think about when writing an app. In this article I will show you an easy way to ask for reviews from your users.

StoreKit

Apple has given us a build in way for accessing the Store, called StoreKit. With StoreKit we can do In-App Purchases, use Apple Music, and give recommendations and ask for reviews.

SKStoreReviewController

For reviews, we want to use the SKStoreReviewController. Before iOS 14 it was as easy as calling SKStoreReviewController.requestReview() but with iOS 14 that method is deprecated. Now we need to call the SKStoreReviewController.requestReview(in windowScene: UIWindowScene . Lucky for us, Apple has given 0 documentation for it.

When I stumbled into this nice problem I was naturally annoyed and disappointed by Apples lack of documentation (again) and started to play around with some code. I realized that we can call the UIApplication singleton object with it’s shared-method and get the first connected scene as UIWindowScene and use that with the requestReview(in:) function.

That simple code works just fine and will let you ask for reviews. But like some people on StackOverflow noticed, it’s not ideal. The code will run into some trouble on iPad, because it is assuming that there is only one WindowScene open.

Better, but we still don’t have any checks when we should ask the user for a review. No one can give a realistic review when they open the app for the first time, so let’s add a check that will ask for a review when the user has opened the app 10, 50 and 100 times! We also want this data to be persistent (if the counter resets when the app closes, the function asking for review will never fire), so we need to save it to user defaults.

With that code we can implement a nice check for iOS 14 and older devices for reviews, and also have a check that asks for review when the app has been opened certain number of times. Of course you still need to call these functions somewhere where it makes sense and doesn’t disrupt the users flow too much. I also moved code getting the UIWindowScene to an extension to make the code read a little better.

Hope you found this helpful! Now go ask for those reviews!

Get in touch
Want to get me to talk in your conference? Build your app? Design your website? What ever it is, get in touch and we can talk about it.
Start Now