I'm implementing In-App purchase feature with Restore button.
I have a brand new test user set up, without any payments made.
When I hit the restore button, and log in with the new test user, I cannot catch any delegated methods that tell me that the restoring transaction has failed (since there is nothing to restore).
The only method that get invoked is -(void)paymentQueueRestoreCompletedTransactionsFinished:(SKPaymentQueue*)queue
, but this method gets called in the case when restoring was successful too.
What can I do now? How can I catch such a case?
Addition: I have a progress indicator that says "Contacting App Store", and I need an invocation where I can hide it in failed cases too.
You can use following delegate method for Restore Transaction.
Noah: here's a code snippet for you:
And the following method:
Let me know if that helps you....
When you restore a transactions, there're two delegated methods:
The first one (paymentQueueRestoreCompletedTransactionsFinished) is called when all the transactions are restored. If you don't have any previous purchase it also calls this method because the restored worked fine but there's nothing to restore.
The other method (restoreCompletedTransactionsFailedWithError) is called when there's an error restoring the transaction.
If you need to show a message to the user telling him he doesn't have any transaction to restore you can use:
Here you have a small snippet for this delegate:
Then you can use the restoredTransaction variable to know if any transaction has been restored on paymentQueueRestoreCompletedTransactionsFinished