我已经在Windows商店发布了一个应用程序,但它暂时隐藏,所以我可以测试。许可信息IsTrial始终如此,即使购买应用程序后
在应用程序中有一个试用版,您可以访问某个级别。我没有任何时间限制。当你购买游戏时,你应该可以访问所有关卡。但是“IsTrial”永远是真的。
private static LicenseInformation _licenseInformation = CurrentApp.LicenseInformation;
public static bool IsLevelEnabled(LevelViewModel level)
{
#if DEBUG
return true;
#else
if (_licenseInformation.IsActive)
{
if (_licenseInformation.IsTrial) //Problem, always true
{
if ([...])//some logic to check is level is enabled in Trial.
{
return true;
}
else
{
return false;
}
}
else //Should go here when you buy the app.
{
return true;
}
}
else
{
return false;
}
#endif
}
我的代码基于https://msdn.microsoft.com/en-us/library/windows/apps/xaml/Dn532253(v=win.10).aspx。
感谢
编辑
别人买我的应用程序在商店,不要以为他试图审判。对他来说一切都很好。他可以进入各个层面。而我仍然陷入审判。
我的水晶球说,你忘了[关闭模拟](http://stackoverflow.com/questions/16241881/simulating-a-windows-8-store-apps-purchase)。 –
我卸载所有内容,然后尝试从商店进行全新安装。我没有碰到WindowsStoreProxy.xml,我没有使用CurrentAppSimulator。我是否需要编写WindowsStoreProxy.xml? – Alxx