UWP试用版和购买的产品,带有完整版且到期 [英] UWP trial version and products purchase that make full version with expiration

查看:213
本文介绍了UWP试用版和购买的产品,带有完整版且到期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在与UWP合作,尝试使该应用程序具有试用版(1个月),并购买具有完整版本且到期(1个月和1年)的产品.

I'm working with UWP and trying to make the app with a trial version (1 month) and products purchase that make full version with expiration (1 month and 1 year).

通常的想法是,当用户首次下载该应用程序时,他的广告试用期为1个月.试用版月后,该应用会询问是否需要购买一段时间的产品,而此删除功能会增加.问题是我不知道如何同时购买完整版和产品有效期,或使完整版具有有效期.

The general idea is, when the user downloads for first time the app, he has a trial period of 1 month with ads. After the month of trial version the app asks that need to buy a product with a periord of time and with this remove adds. The problem is that I don't know how to make at same time the buy of full version and product expiration, or make the full version with expiration.

推荐答案

我相信这里的答案是使用Microsoft Store Engagement and Monetization SDK.应用程序的当前许可证状态存储为LicenseInformation类的属性.因此,在试用期内,用户正在使用试用许可证,并且在购买应用程序时会获得完整的许可证.通常,您将取决于许可证状态的功能放在有条件的块中,即在您的方案中启用或禁用广告.

I believe the answer here is to use the Microsoft Store Engagement and Monetization SDK. The current license state of your app is stored as properties of the LicenseInformation class. So, in the trial period, the user is using a trial license and when they buy the app, they get the full license. Typically, you put the functions that depend on the license state in a conditional block i.e. enable or disable ads in your scenario.

void ReloadLicense()
{
    if (licenseInformation.IsActive)
    {
         if (licenseInformation.IsTrial)
         {
             // Show the features that are available during trial only.
         }
         else
         {
             // Show the features that are available only with a full license.
         }
     }
     else
     {
         // A license is inactive only when there' s an error.
     }
}

这是

Here is the link to the msdn documentation that talks about this in more detail.

希望这会有所帮助.

这篇关于UWP试用版和购买的产品,带有完整版且到期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆