We have had many users reporting that they have paid for our product via in-app purchase but we have failed to unlock the content. The common denominator between these reports is iOS 9. We have offered IAP for years and haven't experienced this issue until now.
We have found that the issue occurs when the customer is prompted to update their App Store payment information during the IAP process. This takes them out of our app. Then upon returning, the content is still locked. I was also able to replicate this by purchasing our product with a store build.
The Apple staff member in this related forum https://forums.developer.apple.com/thread/6431 indicates that the transaction will move to the a SKPaymentTransactionStateFailed when the user is directed out of the app to update their payment information. After updating their information, a SKPaymentTransactionStatePurchased is received. That forum suggests that finishTransaction should be called on the failed transaction. Then, finishTransaction should be called again after SKPaymentTransactionStatePurchased is received and the content is unlocked. This is what we have been doing for a long time but this doesn't appear to be working with iOS 9. It seems that we are only getting a call for the change to SKPaymentTransactionStateFailed but not for a subsequent SKPaymentTransactionStatePurchased. I can't guaruntee that we are not getting the state SKPaymentTransactionStatePurchased call as we can't use the debugger with our store builds but our code is simple enough to say this is very likely
Here is a simplified version of our code:
- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions{
for (SKPaymentTransaction *transaction in transactions)
{
switch (transaction.transactionState)
{
case SKPaymentTransactionStatePurchasing:
break;
case SKPaymentTransactionStatePurchased:
[self completeTransaction:transaction];
[[SKPaymentQueue defaultQueue] finishTransaction:transaction];
break;
case SKPaymentTransactionStateFailed:
[[SKPaymentQueue defaultQueue] finishTransaction:transaction];
break;
case SKPaymentTransactionStateRestored:
default:
break;
}
}
}
We would like to know if others are experiencing IAP issue with iOS 9? Also, is it correct to call finishTransaction after SKPaymentTransactionStateFailed? If we do, will we still receive another delegate call for SKPaymentTransactionStatePurchased?
Any help that can be offered would be appreciated.
Bill