How to create a "Rate My App" prompt for iPhone & iPad
This code is provided totally free without need for payment, attribution, or any restrictions on modification or use. If you would like to hire Orange Group Apps to implement this in your app, our standard quote for the Rating feature is a flat $50.00 per App. Please contact me: michael (at) orangegroupapps.com
While many users may use and enjoy your app, few users will make the effort to rate it. Even worse, sometimes only those motivated by a passionate dislike of your app will take that effort. To remedy this, I decided to create a prompt to ask users to rate my app.
Take a few things into account:
1. You don’t want it to pop up the first time they launch it, because they haven’t used your app yet. I decided to have it pop up the third time the app is opened. I used an integer called “launchCount” to measure this. (Note: on multi-tasking phones, it must be closed then re-opened to increase the count).
2. You don’t want to annoy the user. Have the ability to never show the prompt again. (Boolean “neverRate”).
3. If they do click the “Rate my App” button, you should also never show it again after that.
4. They may want to rate your app, but not right now. Give them the option to remind them the next time the app is opened.
I placed the code in the App Delegate. Inside the applicationDidFinishLaunching method, I simply call [self rateApp]; Be sure to add the UIAlertViewDelegate to the header file. You may copy the following code wholesale, but be sure to change the URL to your own iTunes URL (otherwise you’ll be linking to my app: Hawaiian Names), and change the title and message of the alert view.
The - (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex method handles “buttonIndex” as a integer in the order of the buttons you added to your alert. Starting, of course, at 0, which corresponds to “Rate my App”, we make sure the prompt will never pop up again, then send the user to our app page to rate it. At “buttonIndex” 1, which corresponds to Never ask again, we set the “neverRate” BOOL to YES. At 2, which corresponds to “Remind me later”, we do nothing, and the prompt will pop up again the next time the app is launched.