There have been many complaints about using updateTransactions for recovery. The code below will work, but it requires the user to enter their username and password. (while developers stick to this in an IBAction call that requires a button)
[[SKPaymentQueue defaultQueue] addTransactionObserver:self]; [[SKPaymentQueue defaultQueue] restoreCompletedTransactions];
Then the next delegate is called.
- (void)paymentQueueRestoreCompletedTransactionsFinished:(SKPaymentQueue *)queue { for (SKPaymentTransaction *transaction in queue.transactions) { if ([myItem.productID isEqualToString:transaction.payment.productIdentifier]) { myItem.purchased = YES; } } }
I want to know how to do this without putting the βrestoreβ button on my interface if there are no elements that need to be restored.
source share