我一直在网上搜索几个小时,我仍然无法解决我与我的IAP
有关的问题,我在应用产品中有2个,我在代码中有这个:Windows 8商店应用内购买
private async void RenderStoreItems()
{
picItems.Clear();
try
{
ListingInformation li = await CurrentApp.LoadListingInformationAsync();
foreach (string key in li.ProductListings.Keys)
{
ProductListing pListing = li.ProductListings[key];
System.Diagnostics.Debug.WriteLine(key);
string status = CurrentApp.LicenseInformation.ProductLicenses[key].IsActive ? "Purchased" : pListing.FormattedPrice;
string imageLink = string.Empty;
picItems.Add(
new ProductItem
{
imgLink = key.Equals("AdvertBlocker") ? "/Assets/Purchases/NoAds.png" : "/Assets/Purchases/NoAds.png",
Name = pListing.Name,
Status = status,
key = key,
}
);
}
pics.ItemsSource = picItems;
}
catch (Exception e)
{
System.Diagnostics.Debug.WriteLine(e.ToString());
}
}
这是在Page_Load
然而,在这条线ListingInformation li = await Windows.ApplicationModel.Store.CurrentApp.LoadListingInformationAsync();
我收到一个异常调用。我搜索无处不在,为什么我会收到这样的例外,这里的原因:
- 我还没有添加任何IAP的
- 我的产品ID是不正确的开发中心仪表盘 指定的
但是,我已经做了每一个可能的原因,为什么它不应该工作,但它仍然不起作用?
我也试过,而不是CurrentApp
我用CurrentAppSimulator
它的工作原理,但我收到的无效信息,例如产品的名称将是“微调”,但收到的名称将是“ProductName1”
有没有人明白我在做什么错了?