MKStoreKit icon indicating copy to clipboard operation
MKStoreKit copied to clipboard

receipts is nil in completionHandler of 'startValidatingAppStoreReceiptWithCompletionHandler:'

Open funnel20 opened this issue 10 years ago • 1 comments

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.

funnel20 avatar Sep 20 '15 14:09 funnel20

:+1:

warpling avatar Nov 28 '15 00:11 warpling