UWP:无法访问许可证信息 [英] UWP: Cannot access LicenseInformation

查看:36
本文介绍了UWP:无法访问许可证信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果应用内购买处于活动状态,我将使用以下代码检查我的 UWP-JS 应用:

I am using the following piece of code to check in my UWP-JS app if an in-app purchase is active:

(function () {
    // Initialization
    // var store_app = Windows.ApplicationModel.Store.CurrentApp;
    var store_app = Windows.ApplicationModel.Store.CurrentAppSimulator;
    var licenseInformation = store_app.licenseInformation;

    // Check for Product
    if (licenseInformation.productLicenses["product1"].isActive) {
        // do something
    } else {};
})();

当我调试这个时,第 5 行出现以下错误:

when I debug this I get the following error for line 5:

0x803d0000 - JavaScript 运行时错误:输入数据不是预期格式或没有预期值.

0x803d0000 - JavaScript runtime error: The input data was not in the expected format or did not have the expected value.

我正在关注这个文档

我做错了什么?

I am following this Documentation

What am I doing wrong?

推荐答案

Atom 编辑器搞砸了 WindowsStoreProxy.xml 存档.
我刚刚删除了它,Visual Studio 创建了一个新文件.

The Atom Editor messed the WindowsStoreProxy.xml file up.
I just deleted it and Visual Studio created a new file.

这篇关于UWP:无法访问许可证信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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