Hi,
My app has been shipping for a couple of years. I've never had any problems with In-App Purchases before today, but a few hours ago users started reporting that content wasn't being downloaded successfully. The app reports an error after a purchase is made (shown in the code below).
All of my In-App Purchases are non-consumable and have downloadable content hosted by Apple.
Here're the relevant snippets of code:
- (void)paymentQueue:(SKPaymentQueue*)queue updatedTransactions:(NSArray*)transactions { for (SKPaymentTransaction *transaction in transactions) { switch (transaction.transactionState) { case SKPaymentTransactionStatePurchased: [self transactionComplete:transaction]; break; ...
- (void)transactionComplete:(SKPaymentTransaction*)transaction { [_delegate onBuySuccessful:transaction]; }
In the delegate:
- (void)onBuySuccessful:(SKPaymentTransaction*)transaction { ... if (transaction.downloads.count == 0) { [inAppPurchaseHelper finishTransaction:transaction]; // Error is reported here return; } ...
So, I think the only way this can happen is if SKPaymentTransaction.downloads is empty when the transactionState is SKPaymentTransactionStatePurchased.
I've checked on iTunesConnect, and all of the In-App Purchases appear to be present and correct. I did have an updated legal agreement to review, but I'm assuming that couldn't cause this? In any case, I reviewed and accepted it a couple of hours ago and the problem still persists.
What's the correct way to handle this situation? Could there be a problem with my hosted content, or is this an expected condition and, if so, how should I access the downloadable content for the In-App Purchase?
Many thanks in advance!