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. SKStoreReviewController
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 requestReview()
, Where do i need to call this method? in rootViewController
's viewDidLoad
or in appDelegate
's didFinishlaunching
?
Thanks.
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.
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
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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With