finishTransaction: isn't removing the transaction from queue…

依然范特西╮ 提交于 2019-12-11 12:57:29

问题


I have several non-consumable inApps.

The payment is done once (correctly: SKPaymentTransactionStatePurchased), then the download of the inApp is correctly done (and finished) and finnaly I call

[[SKPaymentQueue defaultQueue] finishTransaction:transaction];

however the transactions remain in the queue... why? aren't they supposed to be removed? also the following isn't being called:

- (void)paymentQueue:(SKPaymentQueue *)queue removedTransactions:(NSArray *)transactions

I've also tried to implement in my finishtransaction method:

for (SKPaymentTransaction *aTransaction in [[SKPaymentQueue defaultQueue] transactions])
{
    [[SKPaymentQueue defaultQueue] finishTransaction:aTransaction];
}

(in case the transaction object i was trying to finish wasn't the correct one, but this also fails to remove the transactions - well most of the times, sometimes it does remove but the behaviour is inconsistent, I can't figure out why they are removed the few times they are actually removed)


回答1:


From your question, it appears that you are trying to download something when purchase completes. In this case, you should probably call finishTransaction before the download starts.



来源:https://stackoverflow.com/questions/6861657/finishtransaction-isnt-removing-the-transaction-from-queue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!