0

I know that in iOS 7, the app's receipt and the In-App Purchase receipts are combined into an encrypted format with a structure shown here, automatically written to storage.

I know receipt(s) have fields, as documented here.

I know how to retrieve the receipt combo by calling appStoreReceiptURL.

I know how to validate that receipt by passing it to Apple servers either directly or via my own server.

But how do I parse the receipt to extract its fields?

I need some kind of identifier for each of the possible In-App Purchases so as to record the user's ownership in a way that I can verify repeatedly later.

Basil Bourque
  • 303,325
  • 100
  • 852
  • 1,154

2 Answers2

0

If you send the receipt to Apple for validation, you will get back a JSON structure with all the receipt fields. Are you asking how to parse this JSON structure?

Chris Prince
  • 7,288
  • 2
  • 48
  • 66
  • No, I am asking if I can later (after validation) read field values from the Receipt package stored by Apple in iOS 7. Apparently the answer is "No" unless I become a crypto expert and decode Apple's encrypted receipt. Instead, if I want the field values I should capture them at the time the validation response arrives from Apple servers. Correct? – Basil Bourque May 31 '14 at 18:40
  • Yes. Sending the receipt to Apple does not change the receipt on your device. – Chris Prince Jun 01 '14 at 17:58
0

Check the issue: A complete solution to LOCALLY validate an in-app receipts and bundle receipts on iOS 7

In one of the provided answer author described the solution how to unseal PKCS7 container by means of OpenSSL and read all the contained fields. But using OpenSSL is only a one way how to read the receipt data. I also know another tool - CargoBay that operates with PKCS7 by means of native iOS methods without any 3-d party libs. I'd recommend also to check this question : iOS Restore in App purchases with receipts

Community
  • 1
  • 1
David
  • 1,061
  • 11
  • 18