1

Right now, when I send a receipt to the sandbox server (sandbox.itunes.apple.com) for one transaction, I am returned information for all of the transactions associated with the Apple account. Is this expected behavior? Is anyone else experiencing this?

Jack Humphries
  • 13,056
  • 14
  • 84
  • 125

1 Answers1

2

Yes, receipt contains information about all transactions that was made by app. But you should consider very important issue:

The in-app purchase receipt for a consumable product is added to the receipt when the purchase is made. It is kept in the receipt until your app finishes that transaction. After that point, it is removed from the receipt the next time the receipt is updated—for example, when the user makes another purchase or if your app explicitly refreshes the receipt.

The in-app purchase receipt for a non-consumable product, auto-renewable subscription, non-renewing subscription, or free subscription remains in the receipt indefinitely.

https://developer.apple.com/library/ios/releasenotes/General/ValidateAppStoreReceipt/Chapters/ReceiptFields.html

  • When transaction state is updated it will notify an object you registered as SKPaymentTransactionObserver by calling method - paymentQueue:updatedTransactions: . After that you should look at transaction state and if it is "purchased" you should make purchased item available for user. – Mikhail Seryukov Mar 12 '15 at 14:54
  • SKPaymentTransaction that was updated has plenty of information about transaction including SKPayment that has a productIdentifier and other useful properties – Mikhail Seryukov Mar 12 '15 at 15:01
  • After your server get response from Apple you should parse whole response and update your server model accordingly. You can not get only changed part of the receipt. – Mikhail Seryukov Mar 12 '15 at 15:11