Tutorial: Review Prompt

As mentioned in our article on Game Quality and Expectations the review score has a big impact on what the user expects of the game and also surprisingly can impact how other people will review your game.  So to take advantage of that you should ensure that you get as many positive reviews as possible.  Reviews are often on the more negative side because the only time users are prompted for a review is when they delete the app, which is normally because they dislike it.

What we did in WarPath – and you should do in your apps too – is have a review prompt in your game to try and get reviews from people who are more likely to rate you positively.  To do this is quite simple, as I will now show you.

Keep track of the amount of time since they installed

When you load the app for the first time, keep a note of the date and at a predefined point in your game check if a number of days have passed and if so go to the next check.

Keep track of the game time

If you track the number of games played, or if that is not suitable for your game the length of time played, you can use this as a check too.  We use this in WarPath to ensure they are fairly active players, and have played a number of games to get a true feel for the game.

Allow users to delay until the next prompt, or disable prompts permanently

Some people will not like this prompt, or it’s not not the right time for them. So ensure you have the option to delay or disable prompts.  Doing this means you won’t annoy the players and risk getting a negative review because they are being pestered by prompts.

Remember you need reviews for each version

As you do updates to your game, remember the app store has ratings for both the current version and all versions.  So ensure you collect some reviews for your new versions too.

Balance your thresholds to get sufficient amount of reviews

Remember that not everybody will review when prompted, and you want to get a large amount of positive reviews to have any effect.  So make sure the thresholds set for timing a prompt aren’t too high. A few 5 star reviews isn’t as good as hundreds of 3-5 star reviews.

Prompt at appropriate times

Ensure that you prompt your players at sensible times, no player is going to be happy getting asked for a prompt during the middle of a game.  In WarPath we prompt once a game is complete.

Code Sample

We store data such as time the app was first started in NSUserDefaults, it is probably the best place to store them.

The properties we will store in NSUserDefaults are as follows

  1. appFirstRun stores the date that the application was first launched.
  2. reviewAllowed stores if we allow prompts (so if user asks for no more asking for reviews this would be set to NO)
  3. gameVersion stores the last version of the game that was rated.  We store what version this is set at when they review the game.
  4. appAskedForRating stores if this version has asked for a rating
  5. gamesPlayed stored how many games have been played this version
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];

 if (! [defaults objectForKey:@"appFirstRun"]) {
     [defaults setObject:[NSDate date] forKey:@"appFirstRun"];
     [defaults setBool:YES forKey:@"reviewAllowed"];
     [defaults setFloat:0 forKey:@"gameVersion"];
     [defaults setBool:NO forKey:@"appAskedForRating"];
     [defaults setInteger:0 forKey:@"gamesPlayed"];
     [[NSUserDefaults standardUserDefaults] synchronize];
 }

In the code above it loads the NSUserDefaults and checks if the app has ran before. appFirstRun is a property we create, so if it doesn’t exist it is the first time they have ran the app. The last line of code just ensures that those values are saved to the NSUserDefaults.  Then we make the checks and updating the values:

if([defaults boolForKey:@"reviewAllowed"]==YES)
 {

First we check if reviews are allowed, if not there is no point in doing the following processing.

if( [defaults floatForKey:@"gameVersion"] < CURRENTVERSION)
 {
   [defaults setObject:[NSDate date] forKey:@"appFirstRun"];
   [defaults setFloat:CURRENTVERSION forKey:@"gameVersion"];
   [defaults setBool:NO forKey:@"appAskedForRating"];
   [defaults setInteger:0 forKey:@"gamesPlayed"];
 }

If the version has changed, we reset all the values apart from reviewAllowed so we can make a check for this version.  CURRENTVERSION is #defined within the code.

 int gamesPlayed = [defaults integerForKey:@"gamesPlayed"];
 gamesPlayed++;
 [defaults setInteger:gamesPlayed forKey:@"gamesPlayed"];

Update the value for games played.  Here we store it as an integer as it is simply the number of games played, if you chose to store it in game time or whatever, you may need to store it in a different format.

 NSInteger daysSinceInstall =
[[NSDate date] timeIntervalSinceDate:
[defaults objectForKey:@"appFirstRun"]] / 86400;

Here we find out how many days has passed since it was first run and divide it by 86400. The function returns seconds since the date so we have to divide it by seconds per day (60secs * 60mins * 24hours = 86400 seconds in a day).

 if (daysSinceInstall > kDaysToRate &&
 [defaults boolForKey:@"appAskedForRating"]== NO &&
 [defaults integerForKey:@"gamesPlayed"] > kPlaysToRate) {
    [self showReviewPrompt];
 }

Here we make the checks to see if we want to ask for a review or not, appAskedForRating is a property we have defined that changes to false when this version has made a prompt.

It would probably also be wise to check if they are connected to the internet, otherwise you might send them to a review prompt when they aren’t even online and that is fairly pointless.

The function showReviewPrompt will setup and display the review prompt however you wish.

 [[NSUserDefaults standardUserDefaults] synchronize];
 }

We end by synchronizing the NSUserDefaults and end the if statement that we opened near the start.

In the Display Review Options you will have 3 functions: one if they chose to rate, one if they chose to delay and one if they chose to have no further prompts.

- (void) rateApp{
    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    [defaults setBool:YES forKey:@"appAskedForRating"];
    [[NSUserDefaults standardUserDefaults] synchronize];
    [[UIApplication sharedApplication] openURL:
    [NSURL URLWithString:@"LINKTOYOURAPP"]];
}

So when the player choses to review your app, you load up the NSUserDefaults, and set the appAskedForRating property to true, this means they will not be prompted again for a review this version.  You then open up the link to your app in the appstore.

- (void) delayRating{
   NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
   int gamesPlayed = [defaults integerForKey:@"gamesPlayed"];
   gamesPlayed = gamesPlayed - NUMGAMESDELAY;
   [defaults setInteger:gamesPlayed forKey:@"gamesPlayed"];
   [[NSUserDefaults standardUserDefaults] synchronize ];
}

When the player decides to delay, what we do is simply reduce the value of the games played. NUMGAMESDELAY will be #defined in the code.

- (void) disableRating{
   NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
   [defaults setBool:FALSE forKey:@"reviewAllowed"];
   [[NSUserDefaults standardUserDefaults] synchronize ];
}

Here is when the player wishes to disable ratings entirely, so as you can see we set the reviewAllowed to false.

And that’s it, with all that I have mentioned you should be able to build your own customizable review prompt and have full control over when and how it happens.

DiggSlashdotDeliciousStumbleUponTechnorati FavoritesTumblrShare
This entry was posted in Development and tagged , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>