내 Universal Windows App에서 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>
왜 이런 일이 일어날 수 있습니까? 난 당신이 제공하는 XML을 사용하는 경우 APPID이 정확하지 수 있기 때문에
감사합니다 :
여기 내 XML입니다! 그러나 어디에서 guid를 찾을 수 있습니까? 애플 리케이션의 세부 사항에는 숫자와 문자 색인만으로는 성 (family name)과 마켓 링크 (market link) 만 볼 수 있지만 가이드가 아닙니다. – Tertium
아, 방금 발견했습니다 - 당신은 테스트를 위해 어떤 guid를 사용할 수 있습니다. 내가 컴퓨터 – Tertium
에 도착했을 때 그것을 무작위로 guid로 확인할 것입니다. 나는 레거시 코드 (windows phone 7+)를 사용한다고 생각한다. guid가 필요하기 때문에 guid가 필요하기 때문에 guid가 필요하다. – Tertium