Problem/Issue: Recently apple has started rejecting application that has inApp purchase option but does not have Restore Button with below rejection reason
We found that your app offers In-App Purchase/s that can be restored but it does not include a “Restore” feature to allow users to restore the previously purchased In-App Purchase/s.
To restore previously purchased In-App Purchase products, it would be appropriate to provide a “Restore” button and initiate the restore process when the “Restore” button is tapped..
- Solution/Steps flow by you: At Space-O we have already implemented inApp purchase in several of our applications and below is the solution / steps that one needs to follow to ensure that the application does not get rejected from apple.
- If user has purchased any pack via in-app purchase and user delete app from the device and then install it again then he/she should not be asked again for purchase the pack which he/she has already purchased.
- Put Restore Button On In-App Purchase Screen
- When user clicks on in-app purchase he asked for user email-id,password and check if user has purchased any pack or not; and if he/she has purchased any pack then it should be opened without asking him/her again for in-app purchase
- Add Restore Transaction Methods in in-app purchase code.
- Reference link:You can read about similar solutions on below links:
- Sample code which you have written
[[SKPaymentQueue defaultQueue] restoreCompletedTransactions];
/*Due to this line it first ask user’s apple id, password and check if user has previously purchased any pack or not. All your in-app purchase methods like updatedTransactions, completeTransaction, provideContent will be called again.. Provide Content will be called as no.of times as user has purchased no of packs. You can update flags,nsuserdefaults or database according to that..*/
//This Method will be called after restore transaction completed..You can set message or alert user that you have restored your packs etc..
– (void)paymentQueue:(SKPaymentQueue*)queue restoreCompletedTransactionsFailedWithError:(NSError*)error
//This Method will be called if user has cancelled transaction or some error occurred..
- Reference Screen shot(s)
We have implmented similar solution in our App: Save The Monkey
In Save The Monkey all the assets /content related to inApp purchase was embedded inside the application, we did another interesting project called Magic Tricks Pro – Magic Trick Video Lessons which pulls the content from a server and the Transaction details of inApp purchase are also managed from server. So if a user clicks Restore Purchases using a API we send request to our server to get all the previous receipts validated and accordingly all the video’s that the user had purchased earlier downloads on his device.
Below is Screen Shot of “Restore Purchases” implemented through server side code.
Please contact us if you have an application that needs fix for the rejection or you are planning to develop an application that needs inApp purchase implemented, Space-O have over a dozen of apps done that have inApp purchased integrated.
This case study was documented and contributed by: Jignesh Thakkar, iPhone App Developer at Space-O Technologies.