Skstore​Review​Controller, How to Use It in a Correct Way

How to use requestReview (SKStore​Review​Controller) to show review popup in the current viewController after a random period of time

In your AppDelegate:

Swift:

import StoreKit

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
let shortestTime: UInt32 = 50
let longestTime: UInt32 = 500
guard let timeInterval = TimeInterval(exactly: arc4random_uniform(longestTime - shortestTime) + shortestTime) else { return true }

Timer.scheduledTimer(timeInterval: timeInterval, target: self, selector: #selector(AppDelegate.requestReview), userInfo: nil, repeats: false)

}

@objc func requestReview() {
SKStoreReviewController.requestReview()
}

Objective-C:

#import <StoreKit/StoreKit.h>

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
int shortestTime = 50;
int longestTime = 500;
int timeInterval = arc4random_uniform(longestTime - shortestTime) + shortestTime;

[NSTimer scheduledTimerWithTimeInterval:timeInterval target:self selector:@selector(requestReview) userInfo:nil repeats:NO];
}

- (void)requestReview {
[SKStoreReviewController requestReview];
}

The code above will ask Apple to prompt the user to rate the app at a random time between 50 and 500 seconds after the app finishes launching.
Remember that according to Apple's docs, there is no guarantee that the rating prompt will be presented when the requestReview is called.

Swift: SKStoreReviewController - how often can it be called?

In short, you choose the appropriate time to display the alert, but the system will decide whether to actually show the alert or not. So don't worry about "over-calling" as long as you don't call it as a response to user interaction.

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.

https://developer.apple.com/documentation/storekit/skstorereviewcontroller/2851536-requestreview

As for your second question, the only reference I can find regarding how many times it might be displayed is "3 times per year". It doesn't mention 3 times per app version or update. Use this API wisely.

open write review page using SKStore​Review​Controller with query parameters action=write-review

here i what i am using

let appID = "Your App ID on App Store"
let urlStr = "itms-apps://itunes.apple.com/app/id\(appID)?action=write-review"
if let url = URL(string: urlStr), UIApplication.shared.canOpenURL(url) {
if #available(iOS 10.0, *) {
UIApplication.shared.open(url, options: [:], completionHandler: nil)
} else {
UIApplication.shared.openURL(url)
}
}

Is SKStoreReviewController helpful in writing a review?

The Submit button of the prompt of requestReview() will redirect you to the Write a Review page of the app, with the stars section already filled out. You can optionally enter a title and a detailed review there. (The description text is misleading, the title is optional.)

From the Ratings, Reviews, and Responses - App Store page of Apple Developer:

Users will submit a rating through the standardized prompt, and can authenticate with Touch ID to write and submit a review.

"Write a Review" page with filled out stars



Related Topics



Leave a reply



Submit