A set of methods that process transactions, unlock purchased functionality, and continue promoted in-app purchases.


protocol SKPaymentTransactionObserver


The methods in this protocol are implemented by observers of an SKPaymentQueue object.

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.


Handling Transactions

func paymentQueue(SKPaymentQueue, updatedTransactions: [SKPaymentTransaction])

Tells an observer that one or more transactions have been updated.


func paymentQueue(SKPaymentQueue, removedTransactions: [SKPaymentTransaction])

Tells an observer that one or more transactions have been removed from the queue.

Handling Restored Transactions

func paymentQueue(SKPaymentQueue, restoreCompletedTransactionsFailedWithError: Error)

Tells the observer that an error occurred while restoring transactions.

func paymentQueueRestoreCompletedTransactionsFinished(SKPaymentQueue)

Tells the observer that the payment queue has finished sending restored transactions.

Handling Download Actions

func paymentQueue(SKPaymentQueue, updatedDownloads: [SKDownload])

Tells the observer that the payment queue has updated one or more download objects.

Handling Purchases

func paymentQueue(SKPaymentQueue, shouldAddStorePayment: SKPayment, for: SKProduct) -> Bool

Tells the observer that a user initiated an in-app purchase from the App Store.


Inherits From

See Also

First Steps

Setting Up the Transaction Observer and Payment Queue

Set up the capability for your app to receive and handle transactions by adding an observer.

Offering, Completing, and Restoring In-App Purchases

Fetch, complete, and restore transactions in your app.

class SKPaymentQueue

A queue of payment transactions to be processed by the App Store.