Hi,
You can use the following code to detect whether in-app purchase process succeeded or failed:
function buyFeature1() {
if (!licenseInformation.productLicenses.lookup("featureName").isActive)
{
// The customer doesn't own this feature, so
// show the purchase dialog.
// note: currentApp is a reference to CurrentAppSimulator from a previous declaration
currentApp.requestProductPurchaseAsync("featureName", false).then(
function () {
//Check the license state to determine if the in-app purchase was successful.
},
function () {
// The in-app purchase was not completed because
// there was an error.
});
}
else
{
// The customer already owns this feature.
}
}
And the licenseInformation.productLicenses.lookup("featureName").isActive can
determine whether the in-app purchase was successfull or not.
Please refer to the document below to get more information:
http://msdn.microsoft.com/en-us/library/windows/apps/hh694067.aspx
Best Wishes!
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. <br/> Click <a
href="http://support.microsoft.com/common/survey.aspx?showpage=1&scid=sw%3Ben%3B3559&theme=tech"> HERE</a> to participate the survey.