UWP trial version and products purchase that make full version with expiration

我们两清 提交于 2019-12-06 15:32:25

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.

Hope this helps.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!