0
在我的通用Windows应用程序中测试iap购买。我之前已经在另一个应用中完成了这个工作,并且它工作。不知道为什么这次不行。 下面的代码:ReloadSimulatorAsync产生“值不在预期范围内”异常
StorageFolder proxyDataFolder = await Package.Current.InstalledLocation.GetFolderAsync("Assets");
StorageFile proxyFile = await proxyDataFolder.GetFileAsync("WindowsStoreProxy.xml");
CurApp.LicenseInformation.LicenseChanged +=() => Log("License info changed");
await Windows.ApplicationModel.Store.CurrentAppSimulator.ReloadSimulatorAsync(proxyFile);
而且ReloadSimulatorAsync产生“值没有在预期范围内”例外!假设它的东西做XML解析,当然,文件存在并具有正确的格式:
<?xml version="1.0" encoding="utf-16" ?>
<CurrentApp>
<ListingInformation>
<App>
<AppId>[my app id]</AppId>
<LinkUri>https://www.microsoft.com/store/apps/[my app store code]</LinkUri>
<CurrentMarket>en-US</CurrentMarket>
<AgeRating>7</AgeRating>
<MarketData xml:lang="en-us">
<Name>MyTestApp</Name>
<Description>AppDescription</Description>
<Price>0.0</Price>
<CurrencySymbol>$</CurrencySymbol>
</MarketData>
</App>
<Product ProductId="product2" LicenseDuration="0" ProductType="Durable">
<MarketData xml:lang="en-us">
<Name>Durable1</Name>
<Price>0.99</Price>
<CurrencySymbol>$</CurrencySymbol>
</MarketData>
</Product>
<Product ProductId="amnt1" LicenseDuration="0" ProductType="Consumable">
<MarketData xml:lang="en-us">
<Name>Consumable1</Name>
<Price>0.99</Price>
<CurrencySymbol>$</CurrencySymbol>
</MarketData>
</Product>
</ListingInformation>
<LicenseInformation>
<App>
<IsActive>true</IsActive>
<IsTrial>false</IsTrial>
</App>
<Product ProductId="product2">
<IsActive>true</IsActive>
</Product>
</LicenseInformation>
<ConsumableInformation>
<Product ProductId="amnt1" TransactionId="00000001-0000-0000-0000-000000000000" Status="Active"/>
</ConsumableInformation>
</CurrentApp>
为什么会这样呢?
谢谢!但我在哪里可以找到指导?在应用程序的详细信息上,我只能看到姓氏和市场与数字字母索引的链接,但它不是一个guid。 – Tertium
啊,刚刚发现 - 你可以使用任何guid进行测试。当我到达计算机 – Tertium
与随机guid它终于工作将检查它。我认为它使用了遗留代码(windows phone 7+),当你不得不使用guid而不是家族id时,需要guid。 – Tertium