Not just modification. I wish I could see what it internally doing and how each class was created, how each of string and json from native IAP system was parsed, and so on
Currently now I have stuck on the problem that, I want to parse and get IAP receipt data. But I don’t want to validate. I want to get data of the receipt to log and send to server first then validate later. If the source code was opened I could look at the source code of how the validator internally parse the receipt, which is far better
From the product receipt property. For example e.purchasedProduct.receipt as mentioned Unity - Manual: Receipt validation And we don’t want to give away our code at this point, sorry.
The problem is ios receipt payload is scrambled in weird format which is not documented in that document. And I want to extract information of that receipt out before validation which that document only mention about getting information after validating it
Yes that’s right
But your link is not the solution I could use. Because it use valitor to validate the receipt to get the data. I want just the data but don’t want to validate it just yet
Correct, you just need product.receipt which may be Base64 encoded. You don’t need to pass it to our validator, you can do anything you want with the receipt instead.
Sorry I would not want to guess what you are seeing. Please show your code, and the results. If it is indeed binary, just post a snippet and I can confirm.
Yes, I have print the receipt with debug log so I see it was some base64 string, and decode it I found out it not actually string data. Instead it was some binary bits jumble with UTF8 string (I remember there is some datetime string and my game bundle ID in there)
But that’s from my office workstation at the middle of my work hour today. At this time is midnight of my timezone and my office was closed (my ios device is also office’s owned). I have write reply at before the end of the day so I can’t provide any more information to you just yet
Nevermind, I have figure out that there is a class responsible for this task. I could write it like this
var parsed = new UnityEngine.Purchasing.Security.AppleReceiptParser().Parse(System.Convert.FromBase64String(rawPayload));
It is indeed not a json string and being a custom format apple used (ASN.1 or something). But as I suspect, unity has internal class that could parse it. Fortunately this namespace was made public or else I could waste more time on this
This is also more of a reason IAP package should just be opensourced. So I could trace a source code to see that unity just use this class to parse the payload. There was no document mention this class. I just try to investigate all the class in this package myself