Protocol: SKPaymentTransactionObserver

Overview

The SKPaymentTransactionObserver protocol declares methods that are implemented by observers of an SKPaymentQueue object.Tells an observer that one or more transactions have been removed from the queue.Tells the observer that an error occurred while restoring transactions.Tells the observer that the payment queue has updated one or more download objects. (required)Tells an observer that one or more transactions have been updated. (required)Tells the observer that the payment queue has finished sending restored transactions.

Instance Method Summary (collapse)

Instance Method Details

- (Object) paymentQueue(queue, removedTransactions:transactions)

Tells an observer that one or more transactions have been removed from the queue. Your application does not typically need to implement this method but might implement it to update its own user interface to reflect that a transaction has been completed.

Parameters:

  • queue (SKPaymentQueue)

    The payment queue that updated the transactions.

  • transactions (Array)

    An array of the transactions that were removed.

Returns:

- (Object) paymentQueue(queue, restoreCompletedTransactionsFailedWithError:error)

Tells the observer that an error occurred while restoring transactions.

Parameters:

  • queue (SKPaymentQueue)

    The payment queue that was restoring transactions.

  • error (NSError)

    The error that occurred.

Returns:

- (Object) paymentQueue(queue, updatedDownloads:downloads)

Tells the observer that the payment queue has updated one or more download objects. (required) When a download object is updated, its downloadState property describes how it changed.

Parameters:

  • queue (SKPaymentQueue)

    The payment queue that updated the downloads.

  • downloads (Array)

    The download objects that were updated.

Returns:

- (Object) paymentQueue(queue, updatedTransactions:transactions)

Tells an observer that one or more transactions have been updated. (required) The application should process each transaction by examining the transaction’s transactionState property. If transactionState is SKPaymentTransactionStatePurchased, payment was successfully received for the desired functionality. The application should make the functionality available to the user. If transactionState is SKPaymentTransactionStateFailed, the application can read the transaction’s error property to return a meaningful error to the user.Once a transaction is processed, it should be removed from the payment queue by calling the payment queue’s finishTransaction: method, passing the transaction as a parameter.Important: Once the transaction is finished, Store Kit can not tell you that this item is already purchased. It is important that applications process the transaction completely before calling finishTransaction:.

Parameters:

  • queue (SKPaymentQueue)

    The payment queue that updated the transactions.

  • transactions (Array)

    An array of the transactions that were updated.

Returns:

- (Object) paymentQueueRestoreCompletedTransactionsFinished(queue)

Tells the observer that the payment queue has finished sending restored transactions. This method is called after all restorable transactions have been processed by the payment queue. Your application is not required to do anything in this method.

Parameters:

  • queue (SKPaymentQueue)

    The payment queue that restored the transactions.

Returns: