我已经在互联网上搜索了几个小时了,我仍然无法解决我的IAP
的问题,我有两个应用程序产品,我的代码中有这样的内容:
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();
会收到一个异常。我到处寻找为什么会收到这样的例外,原因如下:
然而,我已经做了每一个可能的理由,为什么它不应该工作,但它仍然不起作用?
我也尝试过了,而不是CurrentApp
,我使用了CurrentAppSimulator
,但是我收到了无效的信息,例如,一个产品的名称应该是"Spinner“,但是接收到的名称是"ProductName1”
有人知道我做错了什么吗?
发布于 2015-11-23 14:27:04
您需要将ProductID
或Package.AppManifest
中的PhoneProductID
编辑为MSFT在DevCenter上提供的内容。该错误意味着当试图使用错误的GUID
(即Visual提供给您的API 404'd )与商店联系时,是API404‘d。
https://stackoverflow.com/questions/33872662
复制相似问题