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];
- (void) paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions
for (SKPaymentTransaction *transaction in transactions)
- (void) restoreTransaction: (SKPaymentTransaction *)transaction
NSLog(@"Transaction info = %@",transaction.description);
[[SKPaymentQueuedefaultQueue] finishTransaction: transaction];
- (void) provideContent: (NSString*)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