SKPaymentTransaction: what is transactionDate exactly?

≡放荡痞女 提交于 2019-12-22 04:35:24

问题


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:

  1. purchased something at time T1 (transactionDate is T1?)
  2. restored purchase at time T2 (transactionDate is T2 or T1?)
  3. originalTransaction of restored transaction, is its transactionDate T1 or T2?

Thanks!


回答1:


  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.


  1. 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.


  1. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!