vineeth s thayyil
vineeth s thayyil

Reputation: 478

What should we do when SKPaymentTransactionState is SKPaymentTransactionStatePurchasing?

I am integrating inApp in my application when I tried to purchase product using Sandbox user I am getting state as "SKPaymentTransactionStatePurchasing". What should I do?. I was able to purchase the same product earlier

Upvotes: 5

Views: 2411

Answers (2)

vineeth s thayyil
vineeth s thayyil

Reputation: 478

The issue was I was not observing payment queues during app launch. My issue got rectified once I did the same. The reason for issue was after purchasing the pack I was killing the application before finishing the transaction ie [[SKPaymentQueue defaultQueue] finishTransaction: transaction] was never getting called. I added the code for observing inApp transaction ie [[SKPaymentQueue defaultQueue] addTransactionObserver:self]; during app launch and - (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions was getting called on app launch.

Upvotes: 1

Marc Greenstock
Marc Greenstock

Reputation: 11668

The SKPaymentQueue receives a few different of transactionState's. And SKPaymentTransactionStatePurchasing just notifies your app that the iTunes is making a purchase. Normally you can just ignore this unless you want to display something to the user while the purchase is in progress.

You should be more interested in SKPaymentTransactionStatePurchased state which is triggered once the purchase is complete.

Upvotes: 6

Related Questions