UWP: Cannot access LicenseInformation

1

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?

javascript
windows
winapi
windows-store-apps
uwp
asked on Stack Overflow Feb 23, 2017 by jonhue • edited Feb 23, 2017 by jonhue

1 Answer

1

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

answered on Stack Overflow Feb 24, 2017 by jonhue • edited Feb 24, 2017 by jonhue

User contributions licensed under CC BY-SA 3.0