Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SKStore​Review​Controller, How to use it in a correct way?

I have seen some answer but not satisfied with them and got some idea, but don't know how to use it properly, so that it will execute in proper way, though i think it should be used in App delegates didFinishLaunching, but i wanted to be sure before implement it in Live app without any hustle. SKStore​Review​Controller is only work for ios 10.3 what i read, could anybody explain with little bit of code in swift and objective c.

UPDATE:

Actually I'm confused about calling the method request​Review(), Where do i need to call this method? in rootViewController's viewDidLoad or in appDelegate's didFinishlaunching ?

Thanks.

like image 759
Abhishek Mitra Avatar asked Apr 03 '17 05:04

Abhishek Mitra


People also ask

How do you ask for reviews on the app store?

Ask in the upbeat emails you need to send anyway If you're not going to spam your customers inside of your app don't substitute that with spamming them outside of the app. Instead, take a few emails you're going to send anyway, and put your “ask” in them.


2 Answers

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 StoreKitframework.

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

like image 144
korat prashant Avatar answered Oct 01 '22 21:10

korat prashant


For Swift,

import StoreKit 

Add below code to request when you want to ask.

if #available(iOS 10.3, *) {         SKStoreReviewController.requestReview()     } 

For Objective C,

1-) Added StoreKit framework from Link Binary With Library enter image description here

2-) Added framework

#import <StoreKit/StoreKit.h> 

3-) Added below code where you want to call App-Review pop-up. In this case, i added in viewDidLoad.

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

4-) You should be aware of below explain from Apple, When you test in debug mode

When you call this method while your app is still in development mode, a rating/review request view is always displayed so that you can test the user interface and experience. However, this method has no effect when you call it in an app that you distribute using TestFlight.

like image 24
Emre Gürses Avatar answered Oct 01 '22 22:10

Emre Gürses