eugene
eugene

Reputation: 41765

How to detect if there's an in-app-purchase to restore?

I'm letting user click a restore button to call restoreCompletedTransactions.

While performing the restore, I'd like to put a HUD.
How do I detect whether there's something to restore and if restore process has finished(if there was one) so that I can hide the HUD?

Upvotes: 0

Views: 614

Answers (1)

Ed Marty
Ed Marty

Reputation: 39700

The - paymentQueueRestoreCompletedTransactionsFinished: message will be sent to the SKPaymentQueues transaction observers when the process has finished, if successful. If it failed, it the messsage - paymentQueue:restoreCompletedTransactionsFailedWithError: will be sent.

There's no way to immediately determine whether there are any transactions to restore, so you would generally throw up the "Please Wait..." HUD right away. Then the payment queue has to go check to see if there are any transactions to restore, and restore them. Whether there are any to restore or not, one of the messages above will still be sent, so you can then hide your HUD.

Upvotes: 1

Related Questions