I wish to add some sort of a "Write a Review" or "Rate Us" feature to my app so my customers can easily rate and review my app.
Best practice I can think of is to have some sort of pop-up or open a UIWebView within my app so the user is not kicked off of my app while opening the App Store application as done in:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"itms://itunes.com/apps/myAppName"]];
Does anyone knows of a way to do that?
As of iOS 10.3, the StoreKit API provides a way to request a review on the App Store without leaving your app. When called, the system may present the user with an alert that requests a review. The user may provide a star rating directly inside the alert, continue on to write a review, or dismiss the alert. StoreKit handles just about everything for you. To present the review request, make the following call where it is appropriate in your app:
// Objective-C
[SKStoreReviewController requestReview]
// Swift
SKStoreReviewController.requestReview()
As per Apple's instructions, you should not call these in response to a direct user-interaction (i.e. tapping a button that says "Write a Review") because it may not always display the alert. Indeed, the alert may only be displayed three times every 365 days.
Important Note: Although this seems fairly simple, you'll still need to write some kind of logic in order to space out your prompts. For example, to present the prompt only after X number of launches, days, or significant events.
If you fail to do this and just stick the review prompt anywhere (a
viewDidAppear
call, for example), your users will be rather annoyed because they'll see it pretty quickly and repeatedly. Then, either they leave a bad review (because they're annoyed) or aren't asked to review again for a whole year.
Below is an example of what the alert looks like. For more information, see Apple's documentation.
If your app runs on versions of iOS earlier than 10.3 or you need more robust control over requesting ratings from users, iRate is a good solution.
For devices with iOS 10.3 or greater, iRate uses the aforementioned StoreKit API. For devices running iOS 7.0 to 10.2, iRate uses a uialertview and storekit to ask the user for a rating (or to remind them later). Everything is customizable, from the title of the Cancel button to the interval at which it reminds the user.
By default, iRate automatically opens when certain requirements are met (e.g. app launched X number of times, user passed X number of levels), but you can also use a variety of methods and your own logic (with the help of iRate methods) to manually display an iRate popup.
To install, just drag the header file, the implementation file, and the .bundle
(for localization) into your project.
#import "iRate.h"
In your application: didFinishLaunchingWithOptions:
method, set the following:
// Configure iRate
[iRate sharedInstance].daysUntilPrompt = 5;
[iRate sharedInstance].usesUntilPrompt = 15;
The property below is useful for testing purposes. Set it to YES
during testing to make sure the dialog appears properly. When set to YES
it will appear immediately on startup, disregarding other display settings. Set this to NO
for release versions of your app.
[iRate sharedInstance].previewMode = NO;
The appStoreID
property allows you to set the ID of your app. This is only required if you have both Mac and iOS apps with the same Bundle Identifier. The App ID set here must also match the Bundle ID set in Xcode and iTunes Connect:
[iRate sharedInstance].appStoreID = 555555555;
More Details are available on the iRate GitHub page.