UWP: Cannot access LicenseInformation

懵懂的女人 提交于 2019-12-24 08:26:14

问题


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 {};
})();

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

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?


回答1:


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



来源:https://stackoverflow.com/questions/42422150/uwp-cannot-access-licenseinformation

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