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?

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

I just started having this issue recently as well

Same problem here.

iOS 17 Xcode 15 during Unit Test restoreCompletedTransactions always Fails
 
 
Q