Windows Phone应用程序内购买 [英] Windows Phone In-App Purchase
问题描述
我正在尝试在我的应用程序中为Windows Phone 8实施应用程序,但没有运气。我创建了一个测试版应用,并在其中添加了应用内购买产品。我从Beta应用程序中获取了产品ID并将其放入WMAppManifest.xml文件中并重新编译。我尝试在模拟器和设备上运行应用程序但没有运气!
I am trying to implement in app purchase in my app for windows phone 8 with no luck. I've created a beta app and added an in app purchase product to it. I took the product id from the Beta app and put it in the WMAppManifest.xml file and recompiled. I tried running the app in the emulator and on my device with no luck!
我为别名和应用程序名称命名产品FullVersion;
I've titled the product FullVersion for both the alias and in app name;
在我的应用程序中,这是我如何检查购买并继续进行交易。它打开购买页面,但说找不到目录中的项目 - 我们看了但找不到您想要购买的商品。
In my app here's how I am checking the purchase and proceeding with the transaction. It opens the purchase page but says "Can't find item in catalog - We looked but can't find the item you wanted to buy."
private async void Upgrade_Click(object sender, EventArgs e)
{
if (!Store.CurrentApp.LicenseInformation.ProductLicenses["FullVersion"].IsActive)
{
ListingInformation li = await Store.CurrentApp.LoadListingInformationAsync();
string receipt = await Store.CurrentApp.RequestProductPurchaseAsync("FullVersion", false);
}
}
推荐答案
基本上有三种方法可以测试应用程序内购买:
Basically there are 3 ways of testing In-App purchases:
- Create Beta App + Beta products
- Use Mock In-App Purchase Library, download here
- Setup In-app purchase mock service by using IIS
取自: https://channel9.msdn.com/Series/Building-Apps-for-Windows-Phone-8-Jump-Start/Building-应用程序适用于Windows-Phone-8-Jump-Start-16-In-App-Purchasing (查找演示@ 13:30)
Taken from: https://channel9.msdn.com/Series/Building-Apps-for-Windows-Phone-8-Jump-Start/Building-Apps-for-Windows-Phone-8-Jump-Start-16-In-App-Purchasing (look for demo@13:30)
更多信息和代码示例: http: //msdn.microsoft.com/en-us/library/windowsphone/develop/jj681689(v=vs.105).aspx
More info and code samples: http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj681689(v=vs.105).aspx
这篇关于Windows Phone应用程序内购买的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!