1

Is that possible to make the buy & try options in windows phone 8 like in the windows store apps.

One of my game in the windows store is full access for one week from the day of download. After that windows store itself locks the game(If we give 1 week in the dashboard).

Like that, windows phone 8 having any of the features. .


http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh286402(v=vs.105).aspx#BKMK_Runningtheapplication

Even i tried for Buy & try using the above link.

I changed the checklicense() like below.

private void CheckLicense()
    {
        if DEBUG
        string message = "This sample demonstrates the implementation of a trial mode in an application." +
                           "Press 'OK' to simulate trial mode. Press 'Cancel' to run the application in normal mode.";
        if (MessageBox.Show(message, "Debug Trial",
             MessageBoxButton.OKCancel) == MessageBoxResult.OK)
        {
            _isTrial = true;
        }
        else
        {
            _isTrial = false;
        }
        else
        _isTrial = _licenseInfo.IsTrial();
        //Included lines
        if(_isTrail)
            freeversion = true;   //Here Free version trigger when user presses Try
        else
            freeversion = false;   //Here fullversion trigger when user presses Buy
        //Included lines
       endif
    }

If i did like this. I run it in the Master Mode. It always goes for freeversion is false.(i.e: _isTrail is always returns false).

Its because of i have not yet uploaded to windows phone store or some other problem??

Help out to solve this??

Brad Larson
  • 170,088
  • 45
  • 397
  • 571
SaravanaKumar
  • 739
  • 1
  • 7
  • 17

2 Answers2

2

There is no automated way to do that on Windows Phone, you'll have to implement the trial limitation yourself in the app.

Note that uninstalling an app on Windows Phone leaves no traces. Therefore, users will be able restart the trial period if they uninstall/reinstall the app.

Kevin Gosse
  • 38,392
  • 3
  • 78
  • 94
  • Just as an additional note, you can however connect the app to a cloud service (such as an Azure Mobile Service) and 'register' the device. This is not free and you will likely need to make sure that the app still works if it cannot connect. On top of this, if your app does not request internet capability already, it will need to. – Nate Diamond Jul 11 '13 at 16:29
1

Here is the code that i used:

private void CheckLicense()
{
   LicenseInformation licenseInformation = CurrentApp.LicenseInformation;
            try
            {
                var listing = await CurrentApp.LoadListingInformationAsync();
                var _price = listing.FormattedPrice;
                // start product purchase
                await CurrentApp.RequestProductPurchaseAsync("FeatureName", false);

                ProductLicense productLicense = null;
                if (CurrentApp.LicenseInformation.ProductLicenses.TryGetValue("FeatureName", out productLicense))
                {
                    if (productLicense.IsActive)
                    {
                        MessageBox.Show("Product purchased");

                        CurrentApp.ReportProductFulfillment("FeatureName");
                         ProductPurchased();       // It display product purchased & trigger full version
                         return;
                    }
                    else
                    {
                        str = "Purchase failed";
                       ShowErrorPopup(str); // It shows error msg. purchase failed.
                       return;
                    }
                }
           }
           catch (Exception)
            {
                str = "Purchase failed. Check internet connection and try again";
                ShowErrorPopup(str);
                return;
            }
}
Ethan
  • 178
  • 1
  • 1
  • 10