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! :)

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

  1. Excellent! I knew I had to do something similar for my apps going forward, but you’ve done a solid job here and saved me a bunch of time. Thanks! What’s the license?

  2. Pingback: Bug (prompt) users to leave you reviews and rates on Windows Phone Marketplace

    • Honestly, I’m not sure. I haven’t tried it. If you are combining Silverlight + XNA, then it might. But if it’s just XNA, I don’t really think it would.

      Regards

      Igor

  3. Pingback: The best open source components for Windows Phone « igrali wp7

  4. Pingback: Bug (prompt) users to leave you reviews and rates on Windows Phone Marketplace « Silverlight News

  5. Hello, i am expiriencing this exception: ArgumentNullException
    Value can not be null.
    Parameter name: element
    it occurs when i want to fire up the PromptUser() method from Applications_Launching event.
    What should i do to fix it?
    Thank you

  6. Pingback: Review Bugger | Vítejte

  7. I am having trouble with using reviewbugger on my wp7 panorama app. When the popup happens, the message prompt spans the whole panorama making it impossible to use.

    So I then tried to implement in a page one level below panorama to a pivot. Now it pops fine, but if I hit back key and go back to the same page, my app crashes. I have it set to 1 for testing purposes.

    thanks,
    nick

  8. How does it detect whether user did actually rate or review the app or did he just come out of the screen by pressing back arrow?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s