0

is this code from iOS 6 (SKPaymentTransaction)

transaction.transactionReceipt.bytes

completely equivalent to this from iOS 7?

[NSData dataWithContentsOfURL:[[NSBundle mainBundle] appStoreReceiptURL]]

in terms of content?

thanks

Duck
  • 34,902
  • 47
  • 248
  • 470

1 Answers1

1

iOS6 and iOS7 receipts are different. Apple changed the receipt format when going to iOS7 in an effort to improve security. Take a look at: Can Purely On-Device In-App Purchase Receipt Validation Be Done With iOS6? and iOS7 - receipts not validating at sandbox - error 21002 (java.lang.IllegalArgumentException).

If you are talking about using these two methods on iOS7, in my tests, both return iOS7 style receipts. I'm not sure if the receipts are byte by byte identical, however.

Note that transactionReceipt is deprecated in iOS7.

Community
  • 1
  • 1
Chris Prince
  • 7,288
  • 2
  • 48
  • 66
  • *Note that transactionReceipt is deprecated in iOS7.* ... this is why I am asking... :) – Duck Feb 24 '14 at 20:28
  • It took me quite a while to figure out that the receipt formats differ. I found that it wasn't quite clearly enough stated in the docs. And as you say, it would have been nice for the docs to state that, even though deprecated, transactionReceipt returns something quite different in iOS7! – Chris Prince Feb 24 '14 at 20:37
  • yes, that is why I have asked. Apple is famous for vague, crappy or incomplete docs, or all the 3 together. I hate every piece of documentation they ever wrote. If it was not for sites like this, most part of programmers would not be able to code a single line. – Duck Mar 01 '14 at 17:41