MKStoreKit
MKStoreKit copied to clipboard
receipts is nil in completionHandler of 'startValidatingAppStoreReceiptWithCompletionHandler:'
After the In-App Purchase of a non-consumable, I got a nil value for the receipts array in the completionHandler. Although while debugging I saw that NSArray *inAppReceipts contained a valid receipt.
My analysis finds the error in the assignment of NSMutableArray *receipts:
NSMutableArray *receipts = [jsonResponse[@"latest_receipt_info"] mutableCopy];
An NSMutableArray should be properly initialised. When I change the line to:
NSMutableArray *receipts = [[NSMutableArray alloc] initWithArray:[jsonResponse[@"latest_receipt_info"] mutableCopy]];
it works as expected and the completionHandler has the receipt.
Please change this in a future version.
:+1: