I am implementing applications for my iOS application. Apple abandoned my binary code for not recovering purchased products. In my application, when a user removes the product icon, if the item is blocked, he is sent to the inApp purchase process, otherwise the products become open. There is no Buy button. Now an apple says to provide a restore button? Can someone tell me how to handle this? I tried
- (void) checkPurchasedItems { [[SKPaymentQueue defaultQueue] restoreCompletedTransactions]; }// Call This Function //Then this delegate Function Will be fired - (void) paymentQueueRestoreCompletedTransactionsFinished:(SKPaymentQueue *)queue { alreadyPurchasedItems = [[NSMutableArray alloc] init]; NSLog(@"received restored transactions: %i", queue.transactions.count); for (SKPaymentTransaction *transaction in queue.transactions) { NSString *ID = transaction.payment.productIdentifier; [alreadyPurchasedItems addObject:ID]; } }
When the application starts, but the paymentQueueRestoreCompletedTransactionsFinished method is never called, so I can get a list of already purchased items, and then directly inform the user if he / she has already purchased this.
Awais tariq
source share