Is there a way to check if a user has really rated your app?

后端 未结 2 2022
礼貌的吻别
礼貌的吻别 2021-01-18 12:46

I\'m writing a WP7 application and I have code to ask the user for a marketplace review every five runs with an exponential back off so it is less annoying. If the user cli

2条回答
  •  死守一世寂寞
    2021-01-18 13:20

    You can create a check which will check locally if user has rated the application earlier or not. Take a look at following code:

    public void reviewfunction()
        {
            //For Windows phone 8 app
            var settings = IsolatedStorageSettings.ApplicationSettings;
    
            //For windows phone 8.1 app or universal app use the following line of code
            //var settings = Windows.Storage.ApplicationData.Current.LocalSettings;
    
            //set the app name
            string Appname = "My app";
    
            if (!settings.Contains("review"))
            {
                settings.Add("review", 1);
                settings.Add("rcheck", 0);
            }
            else
            {
                int no = Convert.ToInt32(settings["review"]);
                int check = Convert.ToInt32(settings["rcheck"]);
                no++;
                if ((no == 4 || no == 7 || no % 10 == 0) && check == 0)
                {
                    settings["review"] = no;
                    MessageBoxResult mm = MessageBox.Show("Thank you for using this application.\nWould you like to give some time to rate and review this application to help us improve", Appname, MessageBoxButton.OKCancel);
                    if (mm == MessageBoxResult.OK)
                    {
                        settings["rcheck"] = 1;
                        MarketplaceReviewTask rr = new MarketplaceReviewTask();
                        rr.Show();
                    }
                }
                else
                {
                    settings["review"] = no;
                }
            }
        }
    

    Hope this helps you. Source code can be downloaded from here.

提交回复
热议问题