UPDATE: The issue resolved itself. It looks like it was a problem on Apple's end.
I am trying to test my implementation of In-App Purchases with StoreKit:
However, I am getting a bizarre error; the transaction fails right after though the App Store "Confirm your IAP" alert shows up. Here is a synopsis after hours of debugging:
viewDidLoad
, I add the view controller instance (self
) as an observer to the SKPaymentQueue
, and start a SKProductsRequest
, again setting its delegate to self
.productsRequest(_:didReceive:)
, I store the SKProduct
object in the view controller. UI updates as necessary.SKPayment
object and adding it to the SKPaymentQueue
.paymentQueue(_:updatedTransactions:)
receives a transaction object with transactionState
as .purchasing
. All good so far.paymentQueue(_:updatedTransactions:)
receives a transaction object with transactionState
as .failed
. The error
property indicates that the device "Cannot connect to iTunes Store" with an error code of 0.I have tried doing the same with fresh iTunes Connect Sandbox accounts and on multiple devices, but the results are always the same. What should I do?
The IAP on iTunes Connect is marked "Ready To Submit", so I don't think it's because I didn't configure it correctly on ITC.
Edit: To elaborate, IAPs worked before. I tried running previous versions of my code, when it used to work, but the same error occurs.
It's not you. There are dozens of other developers who are having the same issue right now. Largest list active list of issues is here.
The timing of the problem coincides with the release of iOS 10.3 and XCode 8.3. Along with Apple Pay being rolled out in Taiwan. It's an issue with Apple's back end servers. The best we can do is file a bug report and wait.