问题
In Apple's documentation the transactionDate is:
The date the transaction was added to the App Store’s payment queue. (read-only)
I just want to clarify what the transactionDate will be in the following case:
- purchased something at time T1 (transactionDate is T1?)
- restored purchase at time T2 (transactionDate is T2 or T1?)
- originalTransaction of restored transaction, is its transactionDate T1 or T2?
Thanks!
回答1:
- purchased something at time T1 (transactionDate is T1?)
Yes. transactionDate is T1. Following apple's documentation:
transactionDate : The date the transaction was added to the App Store’s payment queue.
- restored purchase at time T2 (transactionDate is T2 or T1?)
Doesn't matter. If transactionState is set to SKPaymentTransactionStateRestored, you should read originalTransaction. Following apple's documentation:
originalTransaction : The contents of this property are undefined except when transactionState is set to SKPaymentTransactionStateRestored. When a transaction is restored, the current transaction holds a new transaction identifier, receipt, and so on. Your application will read this property to retrieve the restored transaction.
- originalTransaction of restored transaction, is its transactionDate T1 or T2?
T1.
回答2:
1) if transactionState is SKPaymentTransactionStatePurchased transactionDate is always T1
2) if transactionState is SKPaymentTransactionStateRestored transactionDate is T2 or T3 (restored date)
3) originalTransaction.transactionDate it's always T1
来源:https://stackoverflow.com/questions/14328374/skpaymenttransaction-what-is-transactiondate-exactly