iOS 17 Xcode 15 during Unit Test restoreCompletedTransactions always Fails

When calling SKPaymentQueue.default().restoreCompletedTransactions() during unit testing it always fails. It calls the restoreCompletedTransactionsFailedWithError with an error message:

 Error Domain=NSURLErrorDomain Code=-1005 "The network connection was lost." UserInfo={NSLocalizedDescription=The network connection was lost., NSUnderlyingError=0x600000eb2790 {Error Domain=kCFErrorDomainCFNetwork Code=-1005 "(null)" UserInfo={_kCFStreamErrorDomainKey=4, _kCFStreamErrorCodeKey=-4, NSErrorPeerAddressKey={length = 28, bytes = 0x1c1ef212 00000000 00000000 00000000 ... 00000001 00000000 }}}}

This is/was working fine in iOS 16 and Xcode 14.

Anyone else seen this issue?

Post not yet marked as solved Up vote post of YishaiR Down vote post of YishaiR
1.1k views

Replies

Have this issue as well, but only in the subscription purchases. Wroks fine with normal purchases. Anyone know how to fix it?

  • I can confirm that being connected to the internet is not an issue, the issue arrises after completing a subscription transaction

Add a Comment

I just started having this issue recently as well

Same problem here.