2016-05-16 24 views

回答

0

听起来像你有未完成的购买,你需要完成。

购买将保持未决状态,直到您的应用程序调用完成为止。这是为了确保您的应用程序处理和验证购买。

你应该叫InAppBilling.service.finishPurchase当你有进程购买,要么提供的产品或办理注销/故障:

https://gist.github.com/marchbold/851359b9e456e1a85d65#file-distriqt-extension-inappbilling-makepurchase-as

private function purchase_cancelledHandler(event:PurchaseEvent):void 
{ 
    // This transaction was cancelled so you should notify your user and finish the purchase 
    trace("purchase cancelled" + event.errorCode); 
    if (event.data && event.data.length > 0) 
     InAppBilling.service.finishPurchase(event.data[0]); 
} 

在启动时可以检索SETUP_SUCCESS后挂起购买事件:

private function setupSuccessHandler(event:InAppBillingEvent):void 
{ 
    var pending:Array = InAppBilling.service.getPendingPurchases(); 
    // Iterate over and handle as required 
} 

http://docs.airnativeextensions.com/inappbilling/docs/com/distriqt/extension/inappbilling/InAppBilling.html#getPendingPurchases()

+0

将getPendingPurchases()清除服务器上的挂起列表? –

+0

不,它将不会清除它们,直到您致电完成购买待处理的购买结果。 – Michael

+0

我在设置成功时做了这个,但getProducts调用似乎锁定在有效的产品ID上(没有事件触发) 'var pending:Array = InAppBilling.service.getPendingPurchases(); (购买:购买待定){ \t InAppBilling.service.finishPurchase(purchase); } InAppBilling.service.getProducts([IAP_PRODUCT_ID]);' –

相关问题