0

I'm testing my Windows Phone 8 app for scenarios where my app goes to the background before it can fulfill a consumable purchase. So, on every app-launch I check if there are any unfulfilled in-app purchases, if there are, I fulfill them using the CurrentApp.ReportProductFulfillment method. However, while testing I noticed this method works even if the device isn't connected to the Internet. So how and when does the app let the Marketplace know that the purchase has been successful? More importantly, should I only do this only if I have an Internet connection?

This is my code by the way :

var licenses = CurrentApp.LicenseInformation.ProductLicenses;
if (licenses["PRODUCT_ID"].IsConsumable && licenses["PRODUCT_ID"].IsActive) {
    // Fulfill consumable purchases

    // Let the Marketplace know
    CurrentApp.ReportProductFulfillment("PRODUCT_ID");
}
4

2 回答 2

0

市场通信发生在操作系统定期生成的后台任务上。如果您将 Fiddler 连接到运行 Windows Phone 模拟器的机器,您可以观察到此流量

以下陈述仅是我的假设,因此请持保留态度。我会想象后台市场通信处理许多任务。其中最常见的是检查应用程序更新。但是,这也是操作系统传达订单履行情况的理想时间。在这种情况下,市场服务可能会排队您的报告请求,如果无法立即传达,则将其推迟到后台任务稍后处理,即使手机没有数据访问权限,该方法也可以运行。鉴于现代无现金交易的性质,我认为市场没有任何理由要求立即通知履行,因为一旦获得初始化授权,它就有时间完成交易。

于 2013-08-24T11:58:23.277 回答
0

CurrentApp.LicenseInformation.ProductLicenses 由 windows phone 操作系统缓存。

于 2015-06-16T11:28:32.550 回答