SKPaymentTransaction: what is a transaction?

The Apple transactionDate documentation has:

The date the transaction was added to the App Store payment queue. (Only for reading)

I just want to clarify what transactionDate will do in the following case:

  • bought something during T1 (transactionDate - T1?)
  • restored purchase at time T2 (transactionDate - T2 or T1?)
  • originalTransaction of the restored transaction, is its transaction T1 or T2?

Thanks!

+8
ios objective-c in-app-purchase
source share
2 answers
  • bought something during T1 (transactionDate - T1?)

Yes. transactionDate - T1. The following documentation for the apple:

transactionDate: The date the transaction was added to the App Store payment queue.


  1. restored purchase at time T2 (transactionDate - T2 or T1?)

Irrelevant. If transactionState set to SKPaymentTransactionStateRestored , you should read originalTransaction . The following documentation for the apple:

originalTransaction: The contents of this property are undefined, unless TransactionState is set to SKPaymentTransactionStateRestored. When a transaction is restored, the current transaction contains a new transaction identifier, receipt, etc. Your application will read this property to restore the restored transaction.


  1. originalTransaction of the restored transaction, is its transaction T1 or T2?

T1.

+6
source share

1) if transactionState SKPaymentTransactionStatePurchased transactionDate is always T1

2) if transactionState is SKPaymentTransactionStateRestored transactionDate is T2 or T3 (recovery date)

3) originalTransaction.transactionDate is always T1

0
source share

All Articles