📜 ⬆️ ⬇️

How to embed an assessment mechanism in Windows and Windows Phone applications

Note translator: in the continuation of the theme of application promotion ( link ), we have prepared for you a translation of a post about the RateReminder control element, which will allow you to automate the user rating request in applications for Windows, Windows Phone, and universal applications for both platforms.



Problem with grades

It is no secret that the higher the app's ratings, the better it is located in the store. Better location means more downloads, but the more downloads, the more money the application brings. But some of the problems with assessments are due to the fact that people rarely evaluate applications. And when they do appreciate it, they do it because either they like the application very much or vice versa they don’t like it very much. InfoSurv, a company that provides marketing services for companies such as CocaCola, Nestle and Emerson, has commented on this issue in its FAQ section :
')
In customer satisfaction surveys, there are shifts in responses towards extreme values ​​of the satisfaction scale, especially among those customers who are very dissatisfied. In other words, very satisfied or, conversely, dissatisfied customers are more likely to take the survey than those who are in the middle. The best way to combat “polarization” of customer surveys is to get the maximum number of responses, thus capturing customers without a clear opinion, and also making surveys more representative of the entire customer base.



So as developers, we have to solve two problems:
  1. Get app ratings from more users.
  2. Detect happy users

We solve the problem with the rating

Obviously, it does not make sense to ask someone to evaluate the application after the first launch - the user will not know what to answer! On the other hand, if the user continues to use the application for a while, we can conclude that the application is valuable to him. Therefore, we also want to poll these users.

In addition to searching for enthusiastic users, a reminder to evaluate the application should:
  1. Track the number of times it has been launched - it helps to find happy users.
  2. Track whether a notification has appeared requesting an evaluation of the application previously. So, we will not annoy users who have already voted or answered that they do not want to vote.
  3. Optional: the application should track the number of days since the application was installed. This is valuable for seasonal applications. For example, the Christmas application is not relevant after December 25 (for those who celebrate it on this date) - users will not use it for a year.
  4. Optional: it should be possible to display a reminder based on the local language. This is important for multilingual applications.

The code that performs these functions is not very complicated, but it includes some components (storage, dialogs, store APIs, localization, etc.). It is template - the same in all applications. Therefore, he is a great candidate to apply to the library.

App Promo

App Promo is a small management library for Windows Phone and Windows 8, created to help with the promotion of applications. At the moment it contains one control - RateReminder - and now you probably have a good understanding of how it can help you.

RateReminder has 4 basic properties:
• RunsBeforeReminder - the number of times the application should be launched before the evaluation reminder is displayed. The default is 7.
• DaysBeforeReminder - the number of days before the reminder should be displayed. The default is 0 (disabled).
• TryReminderOnLoad - true if the control should show a reminder as soon as it loads. Otherwise false . The default is true .
• CustomReminderText - own text that is shown to the user in a reminder. The default is null (means that the control will use the localized localization message).

As you can see, RateReminder is a custom control, but its default settings imply that you can simply put it on the main page of the application and forget about it. And, since the App Promo library is available as a NuGet package, there is no reason not to add it to your app today!

Using App Promo

Let's see how to add an App Promo to the project. Instructions for Windows Phone, but the steps are the same as for Windows 8.

  1. Before you begin, make sure you have NuGet installed. In Visual Studio, click on Tools -> Extensions and Updates . If you see NuGet in the list, it means that it is already installed. If not, write NuGet in the search box and install it (you must restart Visual Studio).



  2. Now you need to install the NuGet App Promo package. You can do this through the Package Manager Console, but I prefer to use the GUI. In Solution Explorer, right-click and select 'Manage NuGet Packages'.

  3. Make sure the 'Online' branch is selected on the left and type 'AppPromo' (without spaces) in the search box.



    Note: Now App Promo is a single package. Make sure you select the “for Windows Phone and Windows 8” package.

  4. Click the 'Install' button next to App Promo. After the installation is complete, close the NuGet window.

    Note: App Promo has been added to your project, but NuGet cannot add controls to your toolbar. You need to do this before you place it on your page.

  5. Open the toolbox, if you haven’t already done so, then click
    Right click on the item 'Choose Items ...'. In the pop-up window, click on the 'Browse' button.



  6. Navigate to the project folder, then to to packages -> AppPromo. #. #. #. # -> lib -> wp8 (or netcore45 , or wp81a for Windows Phone universal).
  7. Double click on AppPromo.WP8.dll (or AppPromo.winmd) and click OK. The RateReminder control should appear in your toolbar.



  8. Move the RateReminder control to the first page of your application (usually it is MainPage.xaml or GroupedItemsPage.xaml ).

    Note: The RateReminder control is completely transparent and has no appearance. If you want to choose it, it’s best to remember where you put it or use the Xaml view or Document Outline.

  9. Optional: Change the number of launches (7 by default) and the number of days (0 by default - disabled).
  10. All is ready! You have just added a voting reminder for your application.

Note from the translator: You can also simply add a RateReminder element in the XAML code:

<appPromo:RateReminder RunsBeforeReminder="7"/> 

Testing the RateReminder control

Testing the RateReminder control is easy. It must be remembered that the application must be closed and restarted in order for it to be considered a “launch” (otherwise the user simply switches between applications). In Visual Studio, you can quickly simulate shutting down and restarting using the reset button.



If you have not connected Visual Studio, you can use the phone's hardware button "Back" to exit the application and then start it again. For Windows 8, use the reset button or move the window to the bottom of the screen to close the application between launches.

Important note !: On Windows 8.1, applications do not actually close until you keep them at the bottom of the screen until they turn over (about 3 seconds).

After 7 launches (or the number you specified), a voting reminder will appear:





Pressing the OK button brings up a rating page in case the application is already in the store. If not, you will see a message with an error that the application is temporarily unavailable.

Use of statistics

RateReminder provides a small set of statistics through the TryReminderCompleted event (if the element is started automatically) or asynchronously through the result of calling the TryReminder method (if manually called). Both return an instance of the RateReminderResult class, which provides the following statistics:


The source code includes an example that shows usage statistics. It is important to note that the counter will give out 0 after the reminder has been shown. This is necessary in order to avoid the cost of reading and updating the settings after the reminder is shown.
The counter can be reset by calling the RateReminder control's ResetCounters method . This will result in a re-showing of the reminder, which may be necessary after the application has been updated to the new version.

Localization

App Promo has been translated into more than 35 different languages, but it is important to understand that your application must also be localized for these languages. This is necessary because the resource loader aims to be as efficient as possible. For example, when your application is running in Spanish, the resource loader will search for Spanish resources in your application. If they are not found, he will no longer continue to search for resources in Spanish when he loads the App Promo library.

Application Localization is not the main topic of this article, but as soon as your application is localized, App Promo will also be shown as localized. The easiest way to localize an application is with the Multilangual App Toolkit. This article is one of the best I've ever seen, and, coupled with introductory video and testing video, is a great resource to get started quickly.

Finally, if you see an error in the translation, please fill out the feedback form or correct it yourself and send the corrected version . Thank!

WinJS and JavaScript support

Starting from version 1.0.0.5 in NuGet, AppPromo supports JS projects with WinJS! JavaScript + HTML projects do not support dragging items from the toolbox, unlike XAML, but adding AppPromo is pretty easy.
After adding the link to NuGet, open the JavaScript file for the main page of your project (usually default.js) and find the following piece of code:

 args.setPromise(WinJS.UI.processAll()); 

Change this line to this block:

 args.setPromise(WinJS.UI.processAll().then(function () { //     rate = AppPromo.RateHelper(); //    rate.tryReminderAsync(); })); 

If you want to change the default settings, such as the number of launches before the reminder appears, you can do something like this:

 args.setPromise(WinJS.UI.processAll().then(function () { //     rate = AppPromo.RateHelper(); //    3   7 rate.runsBeforeReminder = 3; //    rate.tryReminderAsync(); })); 

And if you want to collect any statistics, you can do it this way:

 args.setPromise(WinJS.UI.processAll().then(function () { //     rate = AppPromo.RateHelper(); //    3   7 rate.runsBeforeReminder = 3; // c   rate.tryReminderAsync().then(function (result) { //      numDays.innerText = result.days.toString(); numRuns.innerText = result.runs.toString(); reminderShown.innerText = result.reminderShown.toString(); ratingShown.innerText = result.ratingShown.toString(); }); })); 

Universal application support

Starting from version 1.0.0.9 in NuGet, AppPromo is a universal application. Keep in mind that there are actually 2 separate binary codes, one with the main file for Windows Phone and one for Windows 8. This is due to the fact that AppPromo needs to use different counters for each platform and there is no API (or the author simply not found) that could be used to separate which platform the code is running on. Without split counters, once a reminder is shown for the desktop version of the application, the reminder will never appear on the phone (or vice versa).
If you use NuGet packages, then the correct links to the WinMD file are already preset for you.

Source

The source code for the App Promo has been attached to the article. However, it is strongly recommended to re-check its latest version on GitHub . Do not forget that App Promo is already ready for use on NuGet and here is a direct link to the Nuget- package website.

Special thanks to

I would like to say a separate “Thanks to my colleague and friend” Paul Descarlo . Paul has created NuGet packages for App Promo and is well experienced in promoting apps for Windows Phone and Windows 8. I highly recommend that you watch the post on his blog Monetizing your app with AdRotator .

Source: https://habr.com/ru/post/230169/


All Articles