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.
Adding onto korat's great answer above...
If your supporting a legacy Objective-C app and you want to call DisplayReviewController after a few app opens then do the following:
In your class AppDelegate.m add this:
and in the controller you want to call the function:
SKStoreReviewController
is available in iOS 10.3 and later.According to APPLE's Documents:
Inorder to display Rate/Review inside the app, you have to add
StoreKit
framework.Please find the Sample code for both language:
Objective C:
since xCode 9 you can do:
Swift:
Update: Ask for a rating only after the user has demonstrated engagement with your app
For Objective C,
1-) Added StoreKit framework from Link Binary With Library
2-) Added framework
3-) Added below code where you want to call App-Review pop-up. In this case, i added in viewDidLoad.
4-) You should be aware of below explain from Apple, When you test in debug mode
I think you may implement a method to count when they run the app and store it in UserDefaults, then call requestReview() if the count number is 5 or 10 or something like that (it depends on you), by this way you have more chance of getting a good review.
I think directly calling the below is not an good idea
It can be done like whenever user open your app the multiple of 10(10,20,30,...100) then you can show for review
so first of all you need to create an file which will be responsible for everything like saving your application open count in userdefaults ,retrieving application open count and showing requestReview() kindly have a look to the following code snippet
}