【问题标题】:Buy & try in windows Phone 8?在 Windows Phone 8 中购买和试用?
【发布时间】:2013-07-09 11:02:01
【问题描述】:

是否可以在 windows phone 8 中进行购买和试用选项 就像在 Windows 商店应用程序中一样。

我在 Windows 商店中的一个游戏从下载之日起一周内可以完全访问。之后,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
    }

如果我这样做了。我在主模式下运行它。它总是适用于免费版本是假的。(即:_isTrail 总是返回假)。

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

帮忙解决这个问题??

【问题讨论】:

    标签: windows-phone-8 windows-store-apps trail


    【解决方案1】:

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

    请注意,在 Windows Phone 上卸载应用程序不会留下任何痕迹。因此,用户可以在卸载/重新安装应用后重新开始试用期。

    【讨论】:

    • 作为附加说明,您可以将应用程序连接到云服务(例如 Azure 移动服务)并“注册”设备。这不是免费的,如果无法连接,您可能需要确保该应用程序仍然可以运行。最重要的是,如果您的应用尚未请求互联网功能,则需要。
    【解决方案2】:

    这是我使用的代码:

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

    【讨论】:

      猜你喜欢
      • 2013-11-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-09-29
      • 1970-01-01
      • 1970-01-01
      • 2014-04-10
      相关资源
      最近更新 更多