Anybody know how to make restore option using IAP.
I use non consumable product for purchase.
I know that I have to implement this delegate methods:
- (void)restoreTransaction:(SKPaymentTransaction *)transaction
- (void)paymentQueue:(SKPaymentQueue *)queue restoreCompletedTransactionsFailedWithError:(NSError *)error
- (void)paymentQueueRestoreCompletedTransactionsFinished:(SKPaymentQueue *)queue
but I still can not figure out with a process invoke this method.
I assume that I need to invoke this method [[SKPaymentQueue defaultQueue] restoreCompletedTransactions]; before I get invoke callback method.
Can you explain step by step how it work.
You assume right! The only thing you have to invoke is:
This restores all the completed transactions that the user has made. For each transaction this
SKPaymentTransactionObservermethod is called (the same method is also called each time a user makes a purchase):Using the transactionState you can distinguish whether the transaction was a original purchase (
SKPaymentTransactionStatePurchased) or a restore (SKPaymentTransactionStateRestored) if you need to do that.If you need to know when the restore is finished you can use: