Transaction comes back after finishTransaction: has been called on it

后端 未结 10 1159
一个人的身影
一个人的身影 2020-12-08 15:06

I am using in-app purchase for an iPhone app. I have a class that acts as SKProductsRequestDelegate and SKPaymentTransactionObserver, and it\'s all

10条回答
  •  广开言路
    2020-12-08 15:42

    I have not delved deeply into this, but I was seeing my calls to finishTransaction reliably failing in iOS 4. On a hunch I put the call to finishTransaction in a dispatch_async call and the problem went away.

    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(void) {
      [[SKPaymentQueue defaultQueue] finishTransaction: transaction];
    });
    

    Perhaps a salient point is I was calling finishTransaction from within a block which ultimately ran after a network call to my server.

提交回复
热议问题