2

I am midway in implementing in app purchase (SONGS-non consumable - content delivery from my server ).

When i try to buy the already purchased item, i never received SKPaymentTransactionStateRestored delegate method get called.

I am always receiving SKPaymentTransactionStatePurchased notification.But the Apple alert comes as " You have already purchased this item, Tap ok to download"but the SKPaymentTransactionStateRestored is not called at all.

In this scenerio , does this SKPaymentTransactionStateRestored wont get called?or is that a intended behaviour.

please let me know

user198725878
  • 6,266
  • 18
  • 77
  • 135

2 Answers2

1

I am seeing this for non-consumable IAP restores as well. I think it is a sandbox issue.

Matt Martel
  • 273
  • 2
  • 6
0

SKPaymentTransactionStateRestored is only issued after you call restoreCompletedTransactions.

Since you mention the "you already bought" message, it means you didn't call this method, but are using the standard buy process instead. Getting SKPaymentTransactionStatePurchased is expected in that case.

Gilles Debunne
  • 195
  • 1
  • 6
  • But how do you know when to call restoreCompletedTransactions? How do I know when a user selects to buy something if they have previously bought it without SKPaymentTransactionStateRestored being called? – Will Apr 18 '13 at 13:13
  • 1
    According to the guide lines, an app with IAP should provide a 'Restore purchases' button, that will call `restoreCompletedTransactions`. This is useful when the user re-installs the app on a new device for instance. This is different from the behavior of a 'Buy' button, which will trigger a standard purchase, and can be disabled if the item has already been purchased. – Gilles Debunne May 11 '13 at 19:59
  • Gilles, I ended up figuring out what I needed here: http://stackoverflow.com/a/16091874/1301654 – Will May 12 '13 at 01:40