API Support

Ask a Question
Back to All

Kongregate API functions with callbacks not called

Hi, I'm trying to work the microtransactions API into my game Quepland. It's written in C# using Blazor, but I have been using Javascript interop to call the Kongregate API for submitting high scores.

When trying to do the same thing with mtx.purchaseItems, however, nothing happens. I don't get an error, and the callback function does not get called. Console.log calls work before calling mtx.purchaseItems, but none are called after.

The closest issue I can find is that Unity WebGL games sometimes failed to run callbacks using code from the documentation. Given that I don't get an error, I'm not sure where to look to fix this issue. The code I'm using is literally copied and pasted from the Javascript docs, replacing "sword" with an identifier string. I've pasted a copy below. The second log call is never called, but no error is produced in the log.

purchasePet: function (petIdentifier) {
    console.log("Purchase requested for " + petIdentifier);
    window.parent.kongregate.mtx.purchaseItems([petIdentifier], onPurchaseResult);
    console.log("Post Purchase Requested");
},