Production - "Cannot connect to iTunes Store"

For the last few weeks / months, I've been seeing various users getting the Store Kit transaction error "Cannot connect to iTunes Store" when trying to purchase a subcription in the app.


What's being reported is the transaciton is failing immediately.


The fix is currently for the user to restart their iPhone. Just force quitting / restarting the app doesn't fix it.


It's been reported via email from various users as well as I can see it happening in my analytics.


It's only a certain percentage of users. There's plenty who can actually purchase succesfully, and IAP also works fine in the sandbox / TestFlight.


Any ideas as to what might be causing this ?

Replies

Can you ask your users if they are using the same Apple ID to download the app as they are using to make the IAP purchase or whether they change their username?

I'll make sure to try and ask the next person who reaches out for support, but I'd guess likely *not* as there seems to be too many for that to be the case.. assuming that scenario is a bit of an edge case.

Had a couple more users reach out this morning that they had issues subscribing.


Both did not have multiple App Store accounts / changed their user name.


One user had tried deleteing and reinstalling , but this didn't fix the problem.


Restarting their phone fixed the issue in both instances (as it has in all other instances too).


I should still stress, there are plenty of users who are able to succesfully subscribe the first time. It's just a certain percentage are getting an immediate error back from StoreKit that the transaction failed due to the 'Cannot connect to iTunes' error.


I'm feeling this is really out of my hands in terms of what I can do to fix the issue, and it's really starting to have an impact on sales. Is feedback assistant an appropriate way to report this as a bug or should I be looking at a different avenue ?

All we have is 'feedback assistance'. Perhaps an Apple developer will respond on this forum.

The fact that restarting the device cleared the issue would seem to indicate that the failure may have been caused by the state of iOS on the device at the time of the attempted purchases. I'd say that this was a bug report issue. If this issue were to happen on a device here at Apple, StoreKit engineering would ask for a sysdiagnose archive with the StoreKit profile installed. However this is not feasible to advise a user to do, especially after the fact.


It appears that the app's updatedTransactions delegate method is being called with the SKPaymentTransactionStateFailed (SKPaymentTransactionState.failed) result. When this happens, the app can check the SKPaymentTransaction.error which in this case is 0, an unspecified error occurred. When the app gets the localized description for this error (0), it translates to "Cannot connect to iTunes Store". What this means is that some unspecified error occurred, which isn't a helpful result.


If it turns out that if you (or some developer can replicate this failure) here's the instructions for installing the StoreKit profile and for triggering a sysdiagnose archive.


Here are the instructions to install the StoreKit profile

Install StoreKit profile to an iOS 11+ device

Please login to the Apple Developer Bug Report - Profiles and Logs website

<https://developer.apple.com/bug-reporting/profiles-and-logs/> using Safari on the device you will use to replicate the problem with.

Click the “Profile” URL associated with the “App Store/iTunes Store for iOS” item. You will download the “itmsdebugging.mobileconfig” file.

For iOS 12.2 or later, you will open the Settings app -> General -> Profiles & Device Management -> iTunes and App Stores Diagnostic logging -> press Install

For devices with less than iOS 12.2, - PLEASE RESTART THE DEVICE


CAPTURE THE DEVICE CONSOLE LOG - connect the device to a macOS X Sierra system (macOS X 10.12.x or newer)

1. Launch the Console app on the macOS system, and select the device in the left side of the Console window

2. Before starting the iOS app, click “Clear”.

3. Start the application and perform the steps to replicate the problem.

4. When the issue occurs, save the contents of the Console log

Check the contents of the console log for the string “fetchSoftwareAddOns”. If this string is not present in the log, the profile was not active. Please re-install the StoreKit profile and make sure to restart the device.


To trigger the sysdiagnose archive on an iOS device

1. Press and hold the Volume Up, Volume Down and Sleep buttons at the same time, then release. On an iPhone, there will be a slight vibration. There won't be any haptic feedback if done on an iPad.

2. Wait approximately 5 minutes

3. Open the Settings app -> Privacy > Analytics > Analytics Data

4. Select the "sysdiagnose_" file and share via AirDrop to a Mac.

Note the file will be extremely large. Developers can open a bug report at https://feebackassistant.apple.com. The Apple Developer Bug Report URL will accept large enclosures with the bug report.


rich kubota - rkubota@apple.com

developer technical support CoreOS/Hardware/MFI

Post not yet marked as solved Up vote reply of rich Down vote reply of rich

Ok thanks Rich.


I've submitted a bug report with the relatively limited amount of information I have / can provide.


Appreciate the info on the StoreKit profile. I'll install it the profile on the devices I have here, in the hopes I can catch it at some point. I was actually able to recreate the issue the very first time it was reported, but was also where I discovered a restart would fix it, and haven't seen the issue / been able to recreate since...

We have seen an increased reporting of this over the last month as well. Most users seem to be fine and can complete the purchase, but a small percentage see this error. We respond and include a few things to try, and one of those is restarting the device. We often never hear back from the user, which means it either worked on they moved onto another app.


I'd love to know if this is on Apple's radar. A better error message sure would help.

>I'd love to know if this is on Apple's radar.


File your own and see what comes back...link below.


>A better error message sure would help.


Feel free to file enhancement requests via the bug reporter link below.

Same issue here


For both production and development app, I can not start the transaction process:



Once I click on a subscription, I receive this feedback 99% of the time

"transaction with product: com.**********.*********.SpecialOneYearly Failure with error: Cannot connect to iTunes Store"



a - The code did not change at all, and the issue happened after migrating the iPhone to iOS 13.5 + Xcode upgrade to 11.5

b - The in app purchases were fully working prior to this

c - The same code is working perfectly well on an iPhone 6 iOS 12.4.7


The following troubleshooting was completed

1 - No outage found using Apple system status

2 - Used 2 different internet connections and confirmed internet connections are working

3 - Checked iPhone SW (13.5), Xcode (11.5), and Mac SW (10.15.5) are all up to date

4 - Checked date and time are all working

5 - Restarted both iPhone and Mac

6 - Deleted pods then reinstalled pods

7 - Update pods

8 - Clean build folders

9 - Factory reset of the iPhone


I submitted a ticket to Apple.