【发布时间】:2016-03-09 02:35:21
【问题描述】:
我创建了一个应用程序内购买的应用程序并使用CurrentAppSimulator 对其进行了测试,并且工作正常,但是当我为应用程序创建包时它失败了
这是我正在为其创建包的代码
public async System.Threading.Tasks.Task InAppInit()
{
var listing = await CurrentApp.LoadListingInformationAsync();
// Delux Unlock - Durable
var unlockFeatureDelux = listing.ProductListings.FirstOrDefault(p => p.Value.ProductId == "deluxe" && p.Value.ProductType == ProductType.Durable);
isDeluxPurchased = CurrentApp.LicenseInformation.ProductLicenses[unlockFeatureDelux.Value.ProductId].IsActive;
deluxProductID = unlockFeatureDelux.Value.ProductId;
// Standard Unlock - Durable
var unlockFeatureStandard = listing.ProductListings.FirstOrDefault(p => p.Value.ProductId == "standard" && p.Value.ProductType == ProductType.Durable);
isStarndardPurchased = CurrentApp.LicenseInformation.ProductLicenses[unlockFeatureStandard.Value.ProductId].IsActive;
standardProductID = unlockFeatureStandard.Value.ProductId;
}
我在App.xaml.cs中调用这个方法OnLaunched
【问题讨论】:
-
失败怎么办?错误?结果无效?
-
据我所知,与 Store 合作很糟糕 :) 它经常失败。首先,您可以将代码包装在 try\catch
-
愿意分享一下这个例外是什么?..
-
实际上在商店应用程序中,您创建了一个应该通过不同测试的包,而我的应用程序在“onapplaunch”测试中失败。
-
它没有获得应用内购买 ID
标签: c# windows windows-runtime windows-phone-8.1 windows-store-apps