In-App Purchase failing in iOS 9 after payment update

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

Thanks Rich.

It seems like setting the observer needs to be set REALLY early when the app launches for the unfinished transactions to go through the delegate.

If I set it a bit later in the app, it doesn't seem to called even when there are unfinished transactions in the queue.

Recently We have the same problem, too.

Did you solve your problem?

Can you share your solution?

Hello, I had this issue back in 2015, but recently this issue is coming back. Confirmed on iOS 10.2, and 10.0.2 .

Yep, it's back. It started happening again on Thursday or Friday (Jan 5 or 6). I filed a Radar about the problem with Apple. No response from them yet.


Not much we can do other than hope Apple is aware of the problem and working to fix it.

I see. thanks!

I really hate this bug. Hopefully they fix it ASAP.

The bug is back again 😟


I tried to file a bugreport, but kept receiving error: "SyntaxError: JSON Parse error: Unexpected identifier "RAW"". After refreshing the page, turned out that 3 bugreports have been opened: 29965652, 29965632, 29965612.

we got this problem, too!!!!!

does anyone have a solution?

*sigh*


We are also seeing this again, starting late last week, as others have mentioned. It's an absolute nightmare for our support team as people are understandably upset that they aren't getting what they paid for.


I filed rdar://29967331 and would encourage everyone who is seeing the issue to also file a bug report as multiple reports can tend to get Apple's attention a bit faster.

Unfortunately, AFAIK there isn't really any workaround since the app never gets notified that the purchase succeeded, so all we can do is file bug reports with Apple and hope they fix it quickly. 😟

I'm going to need to work with a developer via a DTS incident to understand the issue here. The issue certainly sounds like a bug report - as so many of you report seeing this issue. I'll provide additional comment if I can.


rich kubota - rkubota@apple.com

developer technical support CoreOS/Hardware/MFI

One more thing - For anyone affected by this issue, please submit a bug report as follows

One of the first things - install the StoreKit profile, and capture a console log from the device as the problem is replicated.


INSTALL THE PROFILE

1. To install the profile to your iOS device, open a Safari browser your device and login to the Apple Developer Bug Report - Profiles and Logs website

<https:/

2. Click the “Profile” URL associated with the “App Store/iTunes Store for iOS” item and follow the instructions to install the profile.

3. Restart the device to activate the profile.

IMPORTANT - PLEASE RESTART THE DEVICE


CAPTURE THE DEVICE CONSOLE LOG

Start the capture before using the application.

There are 2 methods to capture the console log


macOS Console App (macOS 10.12 required)

Attach the device using the lightning cable to your macOS Sierra system.

Open the Consle App.

In the log list picker, select your device. You can clear the console at th epoint you are ready to start the application.

When finshed, use the save button to save the console log contents to file.


To capture a log with Xcode,

1. launch Xcode and open the Devices window

2. attach your device and select it in the devices window

3. Select your device; if the console log is not displayed by default, click the triangle-in-a-box button [^] located at the bottom of the Device Information section of the window to toggle the console log section open ( [v] when the console log section is open).

4 Launch the application and replicate the issue. As soon as the in app purchase failure occurs in the app, save the contents of the console.


To make sure that you’ve captured the log properly with the profile active, open the log file and search for the string “fetchSoftwareAddOns”. If the string is not found, then either the profile was not installed or the device was not restarted OR, the application did not make the SKProductsRequest call while the console log was being captured.


Filing the bug report

Go to the Apple Developer Bug Report web - http://bugreport.apple.com

Select the iTunesConnect product, version Other


In the bug report include the application ID of the app

describe the steps on how to find the in app purchase item

describe the detailed steps to replicate the problem - this includes clearing the credit card information

If a login is required, please describe that step as well.

Include the console log saved from above as an enclosure to the bug report

When you have saved the bug report, send me the bug report number and I'll see that the issue is passed the the correct group.

rich kubota - rkubota@apple.com

developer technical support CoreOS/Hardware/MFI

I will try to reproduce the issue locally and add the log to my bug report, but it's pretty tricky. I'm not sure exactly how to get my App Store account into a state where it wants to verify payment information. I welcome any suggestions. 🙂

Before you launch the app, go into the iTunes settings either on the device or in iTunes on a Desktop system and clear out the credit card info associated with the account. iTunes requires this credit card info be present and current on order to proceed with a purchase.


rich kubota - rkubota@apple.com developer technical support CoreOS/Hardware/MFI

Okay, I have reproduced the problem and attached the log to the bug report. The bug report number is 29967331


Thanks!

I am curious what the apps affected by this problem may have in common. I assume if a truly important app were affected by this, like Clash of Clans or Kim Kardashian's app, then Apple would have noticed the problem and fixed it in a lot less than a week.


We are using non-renewing subscriptions, so I am wondering if it only affects non-renewing subscriptions. What kind of in-app purchase types are other people using?

In-App Purchase failing in iOS 9 after payment update
 
 
Q