Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

receipts is nil in completionHandler of 'startValidatingAppStoreReceiptWithCompletionHandler:' #245

Open
funnel20 opened this issue Sep 20, 2015 · 1 comment

Comments

@funnel20
Copy link

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.

@warpling
Copy link

👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants