Once the transaction has been done on your device, sometimes might so happen that your app gets deleted or removed then it needs to be re-installed on that device. In that case in order to show or highlight all the items that were already purchased , we are required to restore all the transactions. You can either add a button to restore all first or to restore all purchased on click any button going to purchase. It will restore all the ids of the purchased items.
// Method call to restore all the transactions that have been done. NSMutableArray* _productIdsArray = [[NSMutableArrayalloc] init]; [[SKPaymentQueuedefaultQueue] restoreCompletedTransactions]; - (void) paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions { for (SKPaymentTransaction *transaction in transactions) { switch (transaction.transactionState) { caseSKPaymentTransactionStatePurchased: //NSLog(@"Purchase"); [selfcompletedPurchaseTransaction:transaction]; break; caseSKPaymentTransactionStateFailed: //NSLog(@"Failed"); [selfhandleFailedTransaction:transaction]; break; caseSKPaymentTransactionStateRestored: //NSLog(@"restoring"); [self restoreTransaction:transaction]; break; caseSKPaymentTransactionStatePurchasing: //NSLog(@"Puchasing"); break; default: break; } } } - (void) restoreTransaction: (SKPaymentTransaction *)transaction { NSLog(@"Transaction info = %@",transaction.description); [selfprovideContent: transaction.originalTransaction.payment.productIdentifier]; [[SKPaymentQueuedefaultQueue] finishTransaction: transaction]; } - (void) provideContent: (NSString*)productId { [_productIdsArray addObject:productId]; } // _productIdsArray contains all the ids of the already purchased items. // call back methods - (void) paymentQueueRestoreCompletedTransactionsFinished:(SKPaymentQueue *)queue - (void) paymentQueue:(SKPaymentQueue *)queue restoreCompletedTransactionsFailedWithError:(NSError *)error