2013-07-11 55 views
1

是否有可能使购买&在Windows Phone 8 尝试选项,如在Windows应用商店。在Windows Phone 8上购买和试用?

我在Windows Store中的一个游戏是从下载之日起的一周内完全访问。之后,Windows存储本身锁定游戏(如果我们在仪表板中放置1周)。

像那样,windows phone 8具有任何的功能。 。


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

即使我尝试了购买&尝试使用上面的链接。

我改变了checklicense(),如下所示。

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 
    } 

如果我喜欢这样。我在主模式下运行它。它始终是freeversion为false(即:_isTrail总是返回false)。

因为我还没有上传到windows phone store或其他一些问题?

帮忙解决这个??

回答

1

下面是我使用的代码:

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; 
      } 
} 
2

在Windows Phone上没有自动执行此操作的方法,您必须在应用程序中自行实施试用限制。

请注意,卸载Windows Phone上的应用程序不会留下任何痕迹。因此,如果用户卸载/重新安装应用程序,用户将能够重新开始试用期。

+0

感谢您的答复 – SaravanaKumar

+0

只是作为一个附加的注释,但是,您可以连接应用程序到云服务(如Azure的移动服务)和“寄存器' 装置。这不是免费的,如果无法连接,您可能需要确保应用程序仍然有效。最重要的是,如果你的应用程序不需要网络功能,它将需要。 –