10

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!

hzxu
  • 5,753
  • 11
  • 60
  • 95
  • Were you ever able to find this out? – Ser Pounce Sep 13 '14 at 05:42
  • 1
    Additionally, I'd like to see the relation of `transactionDate` with subscriptions explained. If a subscription is renewed, what does `transactionDate` represent then? The last time Apple renewed it? – DarkDust Apr 07 '15 at 11:28

2 Answers2

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

gbuzogany
  • 1,911
  • 16
  • 17
  • Thanks, but apart from citing the documentation (which is not clear enough to me), do you have more infos to back this up? My biggest issue is that _"…added to the App Store’s payment queue."_ is ambiguous to me: does it mean it's the date the actual _purchase_ was done the last time? Or the last time it was put in my `SKPaymentQueue` instance? And last but not least, what about subscriptions? Say, a monthly subscription was purchased in January, it got renewed three times. Which date does `transactionDate` now show? – DarkDust Apr 07 '15 at 11:27
  • The "App Store’s payment queue" in this context is related to the payment queue on Apple's servers. It's the actual purchase, that will be processed by Apple, on their servers. Check that on: https://developer.apple.com/library/prerelease/ios/documentation/NetworkingInternet/Conceptual/StoreKitGuide/Introduction.html#//apple_ref/doc/uid/TP40008267 – gbuzogany Apr 07 '15 at 11:52
  • For the subscriptions, check at: https://developer.apple.com/library/prerelease/ios/documentation/NetworkingInternet/Conceptual/StoreKitGuide/Chapters/Subscriptions.html#//apple_ref/doc/uid/TP40008267-CH7-SW6 What happens in the case you said is that you will have one transaction for each purchase/renewal. – gbuzogany Apr 07 '15 at 11:53
  • Ah, so for every renewal I get a different transaction? That interesting. – DarkDust Apr 07 '15 at 12:16
  • Yes. From the docs: After a subscription is successfully renewed, Store Kit adds a transaction for the renewal to the transaction queue. Your app checks the transaction queue on launch and handles the renewal the same way as any other transaction. Note that if your app is already running when the subscription renews, the transaction observer is not called; your app finds out about the renewal the next time it’s launched. – gbuzogany Apr 07 '15 at 12:24
0

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

ChikabuZ
  • 10,031
  • 5
  • 63
  • 86