App Store Receipt Outdated

I'm using iOS 11 beta 2 and auto-renewable subscriptions using a sandbox user account. I'm parsing/verifying the receipt locally which works fine, except that the receipt does not contain the purchased transaction, not when paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) is called and not even after refreshing the receipt via SKReceiptRefreshRequest (restoring using SKPaymentQueue.default().restoreCompletedTransactions() does have no effect either). The receipt contains all past transactions, just not the current one. The only thing I can do to get an updated receipt is by relaunching the app, but that's not a solution I can apply in a production environment. Any ideas?

Accepted Reply

Okay, there seems to be a bug in the code from http://robin.github.io/swift/ios/2017/01/23/2-Local-Receipt-Validation-in-Swift-3-Preparation/

I resolved the issue by using another library for receipt validation.

Replies

Another "issue" I'm having is that (being logged out of the iTunes Store account on the device) once I enter the credentials of the sandbox user when the app requests it to make an IAP, the system automatically stores the credentials in the system settings (although the documentation states that we should not enter the credentials there, the system does exactly that). It does not seem to do any harm at the moment but it's strange anyways...

1) This would be a bug in iOS11 beta 2 if it were happening the way you described.


>I'm parsing/verifying the receipt

2) and I assume you are also decoding it using OpenSSL before concluding that the latest purchase is not in the receipt - correct?

Yes, I'm basically using the method described in:

http://robin.github.io/swift/ios/2017/01/23/2-Local-Receipt-Validation-in-Swift-3-Preparation/


This gives me all the fields of the app store receipt as well as of the in app purchase receipts therein.


I just don't see why an app relaunch would update the receipt, while a refresh() won't. I need to investigate further...

Okay, there seems to be a bug in the code from http://robin.github.io/swift/ios/2017/01/23/2-Local-Receipt-Validation-in-Swift-3-Preparation/

I resolved the issue by using another library for receipt validation.

Hello,

I'm having this same issue using the code from the blog post you're refencing.


What is wrong about this code? How did you solve it?


Thanks,

Sandro

I don't know what's wrong but I'm using Kvitto now (https://github.com/Cocoanetics/Kvitto) and it works!

Cheers