我一直在(慢)通过应用程序内购买示例。 我在应用程序中为我的应用程序购买了2个应用程序。我已将Visual Studio关联到该应用程序。当我通过请求我的应用程序购买进入回调函数时,我终于没有任何错误。Windows通用应用程序 - 应用程序内购买
的错误:它说,有0产品时,应该有2
我的代码:
var ProductsARR = [];
var storeContext = Windows.Services.Store.StoreContext.getDefault();
var productKinds = ["Consumable", "Durable", "UnmanagedConsumable"];
storeContext.getAssociatedStoreProductsAsync(productKinds).then(function (addOns) {
var i;
if (addOns.extendedError) {
if (addOns.extendedError === (0x803f6107 | 0)) {
alert("This sample has not been properly configured.");
} else {
// The user may be offline or there might be some other server failure.
alert("ExtendedError: " + addOns.extendedError.toString());
}
} else if (addOns.products.size === 0) {
alert("No configured Add-ons found for this Store Product.");
} else {
for (i = 0; i < addOns.products.size;i++){
var item = {
title: addOns.products[i].title,
price: addOns.products[i].price.formattedPrice,
inCollection: addOns.products[i].isInUserCollection,
productKind: addOns.products[i].productKind,
storeId: addOns.products[i].storeId
};
ProductsARR .push(item);
}
}
});
什么能导致它认为有没有在应用内购买,其中有2个?
我认为唯一可能导致混淆的是我还没有将实际的xapproduct提交给商店,但我不想这样做,直到我充实了代码的其余部分。我现在正在开发应用内购买代码。这可能会导致问题吗?
如果不是,还有什么可能导致问题。它在我的仪表板中说应用内购买是'In Store'。