Pinxaton
Pinxaton

Reputation: 457

What are the terminal Store Kit transaction states in iOS?

Which of the following four possible transaction states are regarded as terminal and after which one would need to call PaymentQueue.defaultQueue().finishTransaction...?

Thanks in advance.

Upvotes: 1

Views: 462

Answers (1)

SwiftArchitect
SwiftArchitect

Reputation: 48514

I think you may be looking at it wrong. It's not the state of the payment queue you should worry about per say, but the notifications you are supposed to handle.

The obvious answer to your question would be -finishTransaction on

  1. Failed
  2. Purchased
  3. Restored

But this answer would hide key steps with the transaction:

  1. Is your app actually done with it? Did you permanently grant the user its purchases?
  2. Did you verify the receipt and approve the transaction?

Also, I am a bit worried about the PaymentQueue.defaultQueue().finishTransaction. All the methods in SKPaymentTransactionObserver pass the SKPaymentQueue * to you as one of the parameter. That is what you should use, as exemplified below:

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

Upvotes: 1

Related Questions