I am trying to validate IAP and to send to my server receipt which I then send to apple server to validate, I am using sandbox account and I get all the time status 21002 ( receipt missing or malformed ). I have in Objective C code
SKPaymentTransaction *transaction
object and I am sending
transaction.transactionReceipt
to my server and then pack and pass to apple server. How to encode on client
transaction.transactionReceipt
with base64 ?
Do I need to encode with base64 on client transaction.transactionReceipt
?
Since iOS7 there is another way to get the receipt data. Here is what I do:
NSURL *receiptUrl = [[NSBundle mainBundle] appStoreReceiptURL];
NSData *receiptData = [NSData dataWithContentsOfURL:receiptUrl];
NSString *receiptBase64 = [receiptData base64EncodedStringWithOptions:0];
Then you send receiptBase64 to your server :)