I am sick of the now deprecated openssl dependent method I am using to validate App store receipts.
I'm working on a way to do it using CommonCrypto. In my project I have a folder named _MASReceipt and in it is a test receipt from Apple called reciept.
When I use the method:
The URL appears to be correct: /Contents/_MASReceipt/receipt
But when I try to open the receipt with:
*receiptData is nil and the project logs an error: Domain: @"NSCocoaErrorDomain" - Code: 260
Code 260 is a file not found error. Why can't the apparently correct URL be used as a parameter to other methods?
I'm working on a way to do it using CommonCrypto. In my project I have a folder named _MASReceipt and in it is a test receipt from Apple called reciept.
When I use the method:
Code:
NSURL *receiptURL = [[NSBundle mainBundle] appStoreReceiptURL];
But when I try to open the receipt with:
Code:
NSError *theError;
NSData *receiptData = [NSData dataWithContentsOfURL: receiptURL options: NSDataReadingMappedAlways error: &theError];
Code 260 is a file not found error. Why can't the apparently correct URL be used as a parameter to other methods?