Apple rejected my application due to IAP recovery

I have a Restore button. The problem is that if they didn’t do the “recovery” and they try to purchase the product, and they have already purchased this product, I need to tell them that they have already purchased it and have not completed the purchase. Therefore, I need a way to find out, without making a recovery, which items they purchased. At first I tried to make a recovery when a user tries to buy it, but the apple rejected my application. They said that recovery cannot happen before the Confirm In-App Purchase dialog box appears.

Please help me find the right way.

Thanks in advance.

+8
ios iphone in-app-purchase
source share
3 answers

You can save this data in NSUserDefaults . And you do not need to show an alert that items have already been purchased. If his apple with a non-consumed product shows a warning that they have already purchased this product!

EDIT:

1) You need to add 3 buttons to your view

  • Buy button
  • Recovery button
  • Demo version

You need to tell the user the recovery option if you support in-app purchases in your application. Otherwise, Apple will reject your application.

2) If the user clicks the Buy button, do not check whether the user has purchased your application or not. Because Apple will not charge users twice for the same product that is not consumed. So just review your purchase code, and if the user has already purchased it, the Apple StoreKit infrastructure will call it the delegation method

- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions 

from

SKPaymentTransactionStatePurchased

transaction status. Therefore, you can present him with a login screen.

3) If the user clicks the "Restore" button, just go through with the recovery code

 [[SKPaymentQueue defaultQueue] restoreCompletedTransactions]; 

and, as in the second step, it will call the delegate method with the same transaction state. This way you can present the login page to the user.

4) If the user clicked the demo button, provide him with a demo version.

5) If the user purchased your application, deleted it, and if he reinstalls it, refer to it as a new user. Present these 3 buttons to him, and the user can restore the purchase, and then you can present him the login page.

6) If you really need to keep track of whether the application will be purchased on the exact device, you can use Keychain to store your data, because Keychain items are not deleted, even if the application was deleted or deleted. This api will help greatly link look

or

You can refer to the Apple documentation on Keychain data

+6
source share

According to Apple, "recovery cannot happen before the Confirm In-App Purchase dialog box appears." use - (void) paymentQueueRestoreCompletedTransactionsFinished: (SKPaymentQueue *) function queue , check the code

 - (void)paymentQueue:(SKPaymentQueue *)queue restoreCompletedTransactionsFailedWithError:(NSError *)error { NSLog(@"%@",error); } // Call This Function - (void) checkPurchasedItems { [[SKPaymentQueue defaultQueue] addTransactionObserver:self]; [[SKPaymentQueue defaultQueue] restoreCompletedTransactions]; } //Then this delegate Function Will be fired - (void) paymentQueueRestoreCompletedTransactionsFinished:(SKPaymentQueue *)queue { purchasedItemIDs = [[NSMutableArray alloc] init]; NSLog(@"received restored transactions: %i", queue.transactions.count); for (SKPaymentTransaction *transaction in queue.transactions) { NSString *productID = transaction.payment.productIdentifier; [purchasedItemIDs addObject:productID]; NSLog(@"%@",purchasedItemIDs); } } 
+2
source share

In my opinion, there is no other way to do this.

You should provide the Restore button to restore in-app purchases; Else Apple will reject your application.

You will not connect to the In-App servers or restore profit without displaying a confirmation of purchase confirmation in the application.

+1
source share

All Articles