SKStoreReviewController
is available in iOS 10.3 and later.
According to APPLE's Documents:
You can ask users to rate or review your app while they're using it,
without sending them to the App Store.You determine the points in the
user experience at which it makes sense to call the API and the system
takes care of the rest.
Inorder to display Rate/Review inside the app, you have to add StoreKit
framework.
Please find the Sample code for both language:
Objective C:
#import <StoreKit/StoreKit.h>
- (void)DisplayReviewController {
if([SKStoreReviewController class]){
[SKStoreReviewController requestReview] ;
}
}
since xCode 9 you can do:
#import <StoreKit/StoreKit.h>
- (void)DisplayReviewController {
if (@available(iOS 10.3, *)) {
[SKStoreReviewController requestReview];
}
}
Swift:
import StoreKit
func DisplayReviewController {
if #available( iOS 10.3,*){
SKStoreReviewController.requestReview()
}
}
Update: Ask for a rating only after the user has demonstrated engagement with your app
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…