mattt/CargoBay

transactionReceipt deprecated in iOS 7

koedal opened this issue · 8 comments

The transactionReceipt property in SKPaymentTransaction has been deprecated in iOS 7 and causes warnings in Xcode.

Any word on the progress of this issue? I am trying to decide between using CargoBay, RMStore, or MKStoreKit, which I currently use but is not maintained anymore. None of them address this issue yet as far as I know.

I have searched, googled and looked over documentation, and it says nothing except the property has been deprecated. Also the In-App Purchases Programing Guide (section about Verifying Store Receipts) has been last time updated in 2012.

I have found that receipt validation is changed in iOS7. Please take a look at WWDC 2013 session 308. The receipts are now persisted locally by iOS on the device and you can access them through [[NSBundle mainBundle] appStoreReceiptURL]. The WWDC session presents a new way of validating receipts with openSSL which allows you to make an offline validation.

I haven't reach that session that but I'll probably skip my WWDC schedule and watch that first so that I can update for iOS 7. It seems a big update and the current receipt validation method will be outdated by mid of 2014 because Apple certificate expires then.

Retrieve the receipt data and base64 encode it (using the RFC 4648 form of base64). Use the appStoreReceiptURL method of NSBundle to locate the app’s receipt, and then read the entire file.
If the appStoreReceiptURL method is not available, you can fall back to the value of a transaction's transactionReceipt property for backward compatibility.

ref:https://developer.apple.com/library/ios/releasenotes/General/ValidateAppStoreReceipt/Chapters/ValidateRemotely.html#//apple_ref/doc/uid/TP40010573-CH104-SW1

Fixed by 71fc5ea.

There are several issues with this change:

  1. The documentation for -appStoreReceiptURL (https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSBundle_Class/Reference/Reference.html#//apple_ref/occ/instm/NSBundle/appStoreReceiptURL) specifically says not to use respondsToSelector: on it.

  2. The data that is returned by -appStoreReceiptURL is not a property list dictionary

@newacct +1, rolled back to 2.0.0 here, 2.0.1 just isn't working for me neither.