Bug (prompt) users to leave you reviews and rates on Windows Phone Marketplace

Having a successful application on the Windows Phone Marketplace often depends on the number of reviews and rates that users leave. I always leave reviews for the apps that I really use, but not everyone does that, even though they should. In the next update of my application Photo Light, I will ask (bug) users to leave their reviews after certain amount of app usage. In this article I’ll show you how I did it so you can put it in your apps, too! This way, we can help separating great apps from junk apps.

The class I wrote is called ReviewBugger and is my first class I ever made available through NuGet, to make it even more useful to people. It’s available HERE, In order to install it from the Package Manager Console, run the following command

image

You will notice that it depends on Coding4Fun toolkit because it uses it’s MessagePrompt to prompt user to leave review.

How to use ReviewBugger

There are two things you really need to do if you want to use ReviewBugger – install it like I suggested above, and write a few lines of code. First lines of code you need to write should go to Application Launching event handler, where you call the method CheckNumOfRuns.

private void Application_Launching(object sender, LaunchingEventArgs e)  
        {
            ReviewBugger.CheckNumOfRuns();
        }

Then, on whatever Page in your app you wish to prompt user to leave review, make sure that the Page is loaded and then write:

void SomePage_Loaded(object sender, RoutedEventArgs e)  
        {
            if (ReviewBugger.IsTimeForReview())
            {
                ReviewBugger.PromptUser();
            }
        }

And that’s it! Now, when do I bug the user to leave the review? Mostly, my reasoning was that if the user using the app a lot, then I ask him to review and rate it. I don’t want to be annoying to the people who just downloaded the app, but I want to remind the people who continue to use it that their good reviews and rates encourage me to develop further updates. I’ve come up with the number of 11 runs for my app Photo Light, but you can simply go to ReviewBugger.cs which was added to your project and change the following integer:

private const int numOfRunsBeforeFeedback = 11;

The default message that’s displayed to the user is the following: “"Good rates and reviews encourage me to create and release updates for this app. Would you like to rate --APP NAME-- now?"

where –APP NAME—is the name of your app. You can change just the name or the whole message if you don’t like the default, it’s the following string:

messagePrompt.Message = "Good rates and reviews encourage me to create and release updates for this app. Would you like to rate --APP NAME-- now?";

And that’s it! The user can choose to go and leave the review, do it later or do it never! Fair enough, I’d say.

pl_clanak

The whole class is here:

public static class ReviewBugger  
    {
        private const int numOfRunsBeforeFeedback = 11;
        private static int numOfRuns = -1;
        private static readonly IsolatedStorageSettings settings = IsolatedStorageSettings.ApplicationSettings;
        private static readonly Button yesButton = new Button() { Content = "Yes", Width = 120 };
        private static readonly Button laterButton = new Button() { Content = "Later", Width = 120 };
        private static readonly Button neverButton = new Button() { Content = "Never", Width = 120 };
        private static readonly MessagePrompt messagePrompt = new MessagePrompt();

        public static void CheckNumOfRuns()
        {
            if (!settings.Contains("numOfRuns"))
            {
                numOfRuns = 1;
                settings.Add("numOfRuns", 1);
            }
            else if (settings.Contains("numOfRuns") && (int)settings["numOfRuns"] != -1)
            {
                settings.TryGetValue("numOfRuns", out numOfRuns);
                numOfRuns++;
                settings["numOfRuns"] = numOfRuns;
            }
        }

        public static void DidReview()
        {
            if (settings.Contains("numOfRuns"))
            {
                numOfRuns = -1;
                settings["numOfRuns"] = -1;
            }
        }

        public static bool IsTimeForReview()
        {
            return numOfRuns % numOfRunsBeforeFeedback == 0 ? true : false;
        }

        public static void PromptUser()
        {
            yesButton.Click += new RoutedEventHandler(yesButton_Click);
            laterButton.Click += new RoutedEventHandler(laterButton_Click);
            neverButton.Click += new RoutedEventHandler(neverButton_Click);

            messagePrompt.Message = "Good rates and reviews encourage me to create and release updates for this app. Would you like to rate --APP NAME-- now?";

            messagePrompt.ActionPopUpButtons.RemoveAt(0);
            messagePrompt.ActionPopUpButtons.Add(yesButton);
            messagePrompt.ActionPopUpButtons.Add(laterButton);
            messagePrompt.ActionPopUpButtons.Add(neverButton);
            messagePrompt.Show();
        }

        static void yesButton_Click(object sender, RoutedEventArgs e)
        {
            var review = new MarketplaceReviewTask();
            review.Show();
            messagePrompt.Hide();
            DidReview();
        }

        static void laterButton_Click(object sender, RoutedEventArgs e)
        {
            numOfRuns = -1;
            messagePrompt.Hide();
        }

        static void neverButton_Click(object sender, RoutedEventArgs e)
        {
            DidReview();
            messagePrompt.Hide();
        }
    }

Go, download it, use it, and get more reviews for your application!

Merry Christmas to all of you who celebrate it! :)

comments powered by Disqus