IAP receipt format change

Hi all,


All of a sudden the post request to my server for IAP receipt validation is breaking causing anyone who makes an IAP unable to download the IAP as the receipt validation request to my server fails to send. Removing the receipt from the post data seems to send the request fine.


I am adding the receipt (with NSUTF8StringEncoding) to an NSDictionary and JSON encoding it before sending it off.


If I add the receipt with base64EncodedStringWithOptions instead of UTF8 it sends off fine.


This code has not been changed in 3 or 4 years so I'm not sure what's going on. Have apple changed the formatting of receipts all of a sudden or is it something else?


Many thanks in advance.

>I am adding the receipt (with NSUTF8StringEncoding) to an NSDictionary and JSON encoding it before sending it off.

If I add the receipt with base64EncodedStringWithOptions instead of UTF8 it sends off fine.



According to :

https://developer.apple.com/library/content/releasenotes/General/ValidateAppStoreReceipt/Chapters/ValidateRemotely.html

you need to base64 encode the receipt. So is your question "why was it working before?" If so, perhaps your earlier receipts did not contain the random bit sequence that would have required base64 encoding.

suffice to say, this example in documentation doesnt works anymore.

IAP receipt format change
 
 
Q