问题
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