SKPaymentTransactionObserver Protocol Reference

The SKPaymentTransactionObserver protocol declares methods that are implemented by observers of an SKPaymentQueue object. In a nutshell, what the SKPaymentTransactionObserver class does is observe and catch the callbacks from the payment queue when the iTunes store processes the payment. i.e. it let’s you catch the success and failure events.

The SKPaymentQueue class provides a queue of payment transactions to be processed by the App Store. The payment queue communicates with the App Store and presents a user interface so that the user can authorize payment. The contents of the queue are persistent between launches of your app.

An observer is called when transactions are updated by the queue or removed from the queue. An observer should process all successful transactions, unlock the functionality purchased by the user, and then finish the transaction by calling the payment queue’s finishTransaction: method.

Methods:

Handling Transactions

Handling Restored Transactions

Handling Download Actions

Summary:
1. you implement the required methods, e.g.

which lets you run through all the updated transactions.

2. Then you check the transaction state and, for each state, do the required action. E.g.
If it’s SKPaymentTransactionStatePurchased then you need to complete the transaction.

Remember to call:

after processing each transaction.

Lots more here:
http://developer.apple.com/library/ios/#documentation/StoreKit/Reference/SKPaymentTransactionObserver_Protocol/Reference/Reference.html%23//apple_ref/doc/uid/TP40008262

and a good SO post here:
http://stackoverflow.com/questions/1622116/how-to-provide-storekit-content/1622568#1622568

One thought on “SKPaymentTransactionObserver Protocol Reference

  1. […] implemented the SKPaymentTransactionObserver protocol correctly (see my earlier post – http://www.snowcrash.eu/skpaymenttransactionobserver-protocol-reference/) this method will get […]

Leave a Reply

Your email address will not be published. Required fields are marked *