Dans mon application Windows universelle, je teste les achats iap. Je l'ai déjà fait dans une autre application, et cela a fonctionné. Je n'ai aucune idée pourquoi ça ne marche pas cette fois. Voici le code:ReloadSimulatorAsync produit «La valeur ne se situe pas dans la plage prévue» exception
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);
Et ReloadSimulatorAsync produit « La valeur ne tombe pas dans la plage attendue » d'exception! Supposons que c'est quelque chose à voir avec l'analyse syntaxique xml, mais bien sûr, le fichier existe et a le format:
<?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>
Pourquoi cela pourrait se produire?
Merci! Mais où puis-je trouver le guid? Sur les détails de l'application, je ne peux voir que le nom de famille et le lien du marché avec l'index des lettres, mais ce n'est pas un guide. – Tertium
ah, je viens de trouver - vous pouvez utiliser n'importe quel guid pour les tests. Va vérifier quand je reçois à l'ordinateur – Tertium
avec guid guida finalement travaillé. Je pense qu'il utilise un code hérité (Windows Phone 7+), lorsque vous deviez utiliser guid au lieu de l'ID de la famille, donc guid est nécessaire. – Tertium