Search code examples
iosin-app-purchaseitunes

iOS app re-installation in-app purchase issue


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.


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