你好,
目前官方没有中文示例,可以查看文档实现此需求:
#Enable in-app product purchases (XAML)
https://msdn.microsoft.com/en-us/library/windows/apps/xaml/Dn532254(v=win.10).aspx
>>var ProdList = await CurrentApp.LoadListingInformationAsync(); 实现这个代码就会出异常
建议你使用CurrentAppSimulator 类去测试应用内支付项,这点在上面的文档中有说明:
注意 首次编码和测试新应用内付费内容时,必须使用 CurrentAppSimulator 对象而不是 CurrentApp 对象。这样,你可以使用对许可证服务器的模拟调用验证许可证逻辑,而不是调用实时服务器。若要实现此目的,需要在 <installation_folder>\Microsoft\Windows Store\ApiData 中自定义名为“WindowsStoreProxy.xml”的文件。Microsoft Visual Studio
仿真程序会在你首次运行应用时创建此文件,你也可以在运行时下载一个自定义文件。有关详细信息,请参阅 CurrentAppSimulator 文档。
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.