New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error in parseData? #2
Comments
I need to see the problem myself, either in screen sharing or if you send me the receipt file that cannot be parsed. There is something in there that is unexpected and cannot be deserialized by the ASN1Parser |
Hi Oliver, thanks for getting back to me so swiftly. Here is a zipped NSData: https://www.dropbox.com/s/znsj7t9xq34auuy/receipt.data.zip?dl=0 |
@niklassaers I tried out the data in a unit test:
Works without a problem. I suspect that you were not using Use the recommended way via URL: it is more convenient anyway since you get the receipt URL from the bundle property. |
Hi Oliver,
Using |
You're welcome. This is why the documentation says for the URL-initializer: |
Hey Oliver,
Kvitto looks cool. :-) So I wanted to use it and included it as a CocoaPod. In Dev mode, I parse a receipt, but on line 126 in Receipt.swift I get an error:
guard let rootArray = DTASN1Serialization.objectWithData(data) as? [[AnyObject]]
According to lldb:
If I rewrite this a bit:
I get to know that _rootArray is an NSArray? with a count of 2 where [0] is an NSString and [1] is an Array. The String [0] in my case was "1.2.840.113549.1.7.2", not sure what this is. The NSArray [1] has a count of 1, another NSArray, with 5 elements. I dove into it further but wasn't sure what to make out of it. I've attached the po of _rootArray: https://www.dropbox.com/s/moalpyplpbtcfnk/receipt.txt?dl=0
Do you have any pointers to what I should do?
Cheers
The text was updated successfully, but these errors were encountered: