Question

I have tested in-app purchases on my iOS application but have come across a problem. When I delete the application after purchasing all the things from my test user account in sandbox mode, and then run it again on the device from xcode, the purchases do not show. If I try to purchase again, it says that you have already bought it, would you like to get them for free? Is it normal? or should it automatically get all purchases when it is installed again? Please respond to this query.

Was it helpful?

Solution

Yes it is normal. As @rckoenes said You need to add "restore" button.

If you are using MKStoreKit call this method -

[[MKStoreManager sharedManager] restorePreviousTransactionsOnComplete:^{} } onError:^(NSError *error) {}];

In completion block again check

if([[MKStoreManager sharedManager]isFeaturePurchased:kInAppPurchaseProductId])

So that you can check whether someone already purchased or just pressing restore to get product for free ;)

There is a great video about where and how to put restore button.

In-app Purchase WWDC <- See from 27:30

OTHER TIPS

The messages is normal, if you bought something you will not have to purchase if again. Also you will need to add a button to restore previous purchases.

You can restore purchases by calling restoreCompletedTransactions on SKPaymentQueue

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top