Below is my code to get base 64 string from receipt data, but some how its coming up as null in iOS 9 beta.
NSURL *receiptURL = [[NSBundle mainBundle] appStoreReceiptURL];
NSData *receipt = [NSData dataWithContentsOfURL:receiptURL];
if (!receipt) { /* No local receipt -- handle the error. */
NSLog(@"receipt is nil");
}
else
{
NSString *base64String = [receipt base64EncodedStringWithOptions:0];
NSLog(@"receipt base 64:%@",base64String);
}
And here is the log:
receipt base 64:(null)
I am getting other transaction data fine, just receipt is getting as null
<transactions><transaction><error></error><pid>ss_10106</pid><q>1</q><date>1435589871.000000</date><id>1000000161261453</id><receipt>(null)</receipt><state>1</state><error_code>-1</error_code><og> </og></transaction></transactions>
Can anybody suggest whats going on?
looks like its fixed in iOS 9 beta 4 (came out yesterday) https://developer.apple.com/ios/download/