1
votes

I'm quite confused applying InApp Purchase using a server model.

I read this in the StoreKit Guide:

If the user attempts to purchase a nonconsumable product or a renewable subscription they have already purchased, your application receives a **regular transaction for that item, not a restore transaction. However, the user is not charged again for that product. Your application should treat these transactions identically to those of the original transaction.

So tell me how will i knw that whether the user has purchased the item or he has restored the item????

1

1 Answers

0
votes

You should keep track of the items that have been purchased and remove them from the list of options the user has to buy.

If you do this, the user will never attempt to purchase something they have already punched.

When the app is first installed you may want to restore items that have been previously purchased (if there are any). To do this you call restoreCompletedTransactions and you get a separate callback to normal: paymentQueueRestoreCompletedTransactionsFinished:.

To answer your question.

  1. Restored items come in on the paymentQueueRestoreCompletedTransactionsFinished: method

  2. Items purchased normally come in on the paymentQueue:updatedTransactions: method

  3. Items purchased normally, which have already been paid for, come in on the paymentQueue:updatedTransactions: method.

You can not tell the difference between 2. and 3. This is done on purpose.