Domanda

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.

È stato utile?

Soluzione

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

Altri suggerimenti

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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top