Windows 8 object and windows 10 Universal export?

0 favourites
From the Asset Store
Creepy Sprite Font suitable font for your Dark/Horror/Halloween games.
  • Having a few issues and would like to know if the "windows 8" objects functions actually work with "Windows 10 Universal" Export? Or I need to drop back the export to 8.1 Universal.

  • As of r233, it should work correctly on both, so long as the features are available (e.g. charms were removed from Windows 10, so features relating to that won't work)

  • Excellent, yes I see that the test state is now working.

    I have one question though, how do you edit the purchases that are available to test without an equivalent WindowsStoreProxy file so that you can set those prospective purchases to active?

    Before in the Windows 8.1 universal export the file WindowsStoreProxy.xml was available to add in these IAP's. Without this I am always getting a return of "purchase finished but product not active"

  • And I dont know if this is a bug, but exporting with Test mode it runs fine in VS

    However turn off test mode, export and run in VS produces this error.

  • In answer to your question about the location of WindowsStoreProxy.xml in Windows 10 apps - it is now dynamically built and available in the packages path.

    C:\Users\<username>\AppData\Local\Packages\<app package folder>\LocalState\Microsoft\Windows Store\ApiData\WindowsStoreProxy.xml

    After export make sure you build/run visual studio at least once to so the <app package folder> is created. Browse in file explorer to C:\Users\<username>\AppData\Local\Packages\, sort by "Date created" and there it is!

    You can then copy that file to the root of your Windows 10 project and it's editable from there.

    https://msdn.microsoft.com/en-gb/window ... -purchases

    Hope this helps!

  • Regarding your problem with Visual Studio crashing when not in "test" mode basically the call to IAP fails and takes out the runtime. I fixed this by altering my non-compressed c2runtime.js so that the calls to the windows IAP are wrapped in try catch statements. Not ideal, but got me through the problem!

    Windows8Store.prototype.purchaseProduct = function (product_) {

    if (product_ === "app") {

    this.purchaseApp();

    return;

    }

    var self = this;

    try {

    var productLicenses = this.currentApp["licenseInformation"]["productLicenses"];

    this.currentApp["requestProductPurchaseAsync"](product_, false).then(

    function () {

    if (productLicenses["hasKey"](product_) && productLicenses["lookup"](product_)["isActive"]) {

    console.log("[Construct 2] Product '" + product_ + "' purchased OK");

    if (self.onpurchasesuccess)

    self.onpurchasesuccess(product_);

    }

    else {

    console.log("[Construct 2] Product '" + product_ + "' purchase failed (cancelled?)");

    if (self.onpurchasefail)

    self.onpurchasefail(product_, "failed");

    }

    },

    function (msg) {

    console.log("[Construct 2] Product '" + product_ + "' purchase failed: " + msg);

    if (self.onpurchasefail)

    self.onpurchasefail(product_, msg);

    });

    } catch (e) {

    console.log("[Construct 2] Product '" + product_ + "' purchase failed - server not available");

    if (self.onpurchasefail)

    self.onpurchasefail(product_, "purchase failed - server not available");

    }

    };

    Windows8Store.prototype.restorePurchases = function () {

    };

    Windows8Store.prototype.requestStoreListing = function () {

    var self = this;

    try {

    this.currentApp["loadListingInformationAsync"]().then(

    function (listing) {

    console.log("[Construct 2] Listing information loaded");

    self.appName = listing["name"];

    self.appFormattedPrice = listing["formattedPrice"];

    self.lastProductListings = listing["productListings"];

    if (self.onstorelistingsuccess)

    self.onstorelistingsuccess();

    });

    } catch (e) {

    if (self.onstorelistingfail)

    self.onstorelistingfail();

    }

    };

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hi all

    AaronSmithUK

    Ashley

    I have same issue as AaronSmithUK, how i can fix it?

  • You could apply the try catch fixes I specified in the iap file:

    C:\Program Files\Construct 2\exporters\html5\plugins\iap\runtime.js

  • AaronSmithUK

    Thank you for answer, but how i can do this? You managed to do it?

  • Hi, yes it's easy enough. Open C:\Program Files\Construct 2\exporters\html5\plugins\iap\runtime.js - find the function - "Windows8Store.prototype.purchaseProduct" replace it with the version I specified above. Do the same for function: "Windows8Store.prototype.requestStoreListing". You might need to open the file as admin in notepad or whatever editor as it's in the program files. Restart Construct 2, export to Windows - it should export a c2runtime.js with the alterations. Basically it means that when your app runs in Windows (not in test mode) it won't crash and so can pass certification. When it's passed certification and your iap is live, it should work just fine.

  • AaronSmithUK

    Thank you so much man! It helped me! Why Ashley can't fix it?

  • Please file a bug if anything isn't working properly.

  • radbrothers - if you can confirm my fix worked I'll file a bug along with the fix.

  • The original issue was filed as a bug here:

  • AaronSmithUK

    Thanks for the fix man! My project is working and not crashing anymore.

    But how to I make use of the "WindowsStoreProxy.xml" file?

    Where should I place it in the VS project folder?

    Do I have to add all my store IAPs into this file?

    Any help would be really great, I am only stuck at this point, everything is working well. FOr some reason C2 wants to make our lives miserable. Every update to our game is a nightmare!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)