Thursday 29 November 2012

Add 'Rate This App' Feature To iphone App Using Appirater...

Appirater - Remember your users to Rate your App (iOS)

I saw that @mitchellapps posted a similar tutorial but it uses a different approach and I think Appirater has a more active support and it can be easily localized. 

Tutorial: 
1 - Download source code from https://github.com/arashpayan/appirater 

2 - Copy the files to your project (only the .h and .m files are required, the other files are optional) 

3 - Add CFNetwork and SystemConfiguration frameworks (They are added by default on BT 1.5) 

4 - Open xxx_appDelegate.m and make the following changes: 

4.1 - Add #import "Appirater.h" (I'm not telling you where to add this, come on!!!) 

4.2 - At the end of the didFinishLaunchingWithOptions method before the "return TRUE;" add the following line (don't forget the ; at the end): 
[Appirater appLaunched:YES]; 

4.3 - Right after the didFinishLaunchingWithOptions method add another method as following: 
//Appirater Entered Foreground 
-(void)applicationWillEnterForeground:(UIApplication *)application{ 
[Appirater appEnteredForeground:YES]; 
} 

4.4 - Congratulations, you are done tweaking BT source code!!! Now lets configure the Appirater code... 

5 - Open the Appirater.h file that you copied to your project. This file is very well commented, but if you are rrreeeeallllyyyy lazy I will show you the most important options: 

5.1 - Enter your iTunes Connect App ID at the #define APPIRATER_APP_ID line. 
5.2 - APPIRATER_DAYS_UNTIL_PROMPT - number of days the user will have to have your app installed before prompting, anything from 10 to 20 should be fine. 
5.4 - APPIRATER_USES_UNTIL_PROMPT - number of times a user has to use your app before they get prompted to rate it, anything from 5 to 10 should be fine. 
5.5 - APPIRATER_TIME_BEFORE_REMINDING - If the user taps the "Remind me later" options thats the amount of days the app will wait to prompt the user again. I like to use 1 or 2. 

6 - To localize it to any language all you need to do is create a localization for your project (I'm not covering this), add the following strings and change the second part of each string: 

/* Appirater */ 
"If you enjoy using %@, would you mind taking a moment to rate it? It won't take more than a minute. Thanks for your support!" = "If you enjoy using %@, would you mind taking a moment to rate it? It won't take more than a minute. Thanks for your support!"; 
"Rate %@" = "Rate %@"; 
"No, Thanks" = "No, Thanks"; 
"Remind me later" = "Remind me later"; 

7. Debugging: 
7.1 At the Appirater.h file search for APPIRATER_DEBUG, it's set to NO by default but if you want to test/debug you can set it to YES and it will show you the alert everytime you open the app. 
7.2 !IMPORTANT! Remember to set it to NO before submitting your app to the App Store. 

I think this is my first tut here on BT, so please be nice and don't be lazy. Its a VERY simple modification and even beginners can do this if they put some effort.
 Appirater as used in Prayer Book app

No comments:

Post a Comment