Storekit sandbox accounts generating errors on device

Xcode 14.2 iOS 16.0.2

I am running my app through Xcode on my iPhone 13 Pro. Some time ago I have used some Sandbox test accounts to do in apps purchases. It seems that those purchases generate errors now for some unknown reason, and considering the error code I don't think it's on my side:

When starting my app I start listening for transactions through:

     return Task.detached {
      for await verificationResult in Transaction.updates {

A bit after starting this I see the following error several times in the log output:



[Default] Error enumerating all current transactions: Error Domain=ASDErrorDomain Code=500 "Unhandled exception" UserInfo={NSUnderlyingError=0x28156b630 {Error Domain=AMSErrorDomain Code=2 "Finance Authentication Error" UserInfo={NSLocalizedDescription=Finance Authentication Error, AMSURL=https://mzstorekit-sb.itunes.apple.com/inApps/v1/history?guid=00008110-001414803EA2801E&reason=initial, AMSStatusCode=401, NSLocalizedFailureReason=No delegate to perform authentication: <AMSAuthenticateRequest: 0x100e43920> {
 account = ***@******.be (9A040C11-C4A6-4D23-A7A2-450F363B8751),
 logKey = 789580B8,
 options = <AMSAuthenticateOptions: 0x100e4f910> {
 AMSAuthenticateOptionsAllowPasswordGeneration = 0,
 AMSAuthenticateOptionsAllowSecondaryCredentialSource = 0,
 AMSAuthenticateOptionsAllowServerDialogs = 0,
 AMSAuthenticateOptionsAuthenticationTypeKey = 1,
 AMSAuthenticateOptionsCanMakeAccountActiveKey = 0,
 AMSAuthenticateOptionsClientInfo = {length = 823, bytes = 0x62706c69 73743030 d4010203 04050607 ... 00000000 0000029d },
 AMSAuthenticateOptionsCredentialSourceKey = 0,
 AMSAuthenticateOptionsDebugReason = no dialogResponse in AMSFinanceAuthenticateResponse,
 AMSAuthenticateOptionsEnableAccountCreationKey = 0,
 AMSAuthenticateOptionsEphemeralKey = 0,
 AMSAuthenticateOptionsForceSyncToPairedWatchKey = 0,
 AMSAuthenticateOptionsIgnoreAccountConversion = 0,
 AMSAuthenticateOptionsLogKeyKey = 789580B8,
 AMSAuthenticateOptionsRemoteProxyAuthenticationKey = 0,
 AMSAuthenticateOptionsServiceType = 2,
},
}}}, storefront-country-code=BEL, client-environment-type=Sandbox, NSLocalizedFailureReason=An unknown error occurred, NSLocalizedDescription=Unhandled exception}

What is going on and how can I get rid of those errors?

I am seeing the same thing. I wish I had an answer for you.

I ran into the same issue and wrote a solution found at the link below:

https://www.delasign.com/blog/xcode-store-kit-fix-finance-authentication-error

Please note that the solution described above resolves this issue, and also resolves 2 other errors that could arise:

  1. [Default] Error enumerating all current transactions: Error Domain=ASDErrorDomain Code=509 "No active account" UserInfo={storefront-country-code=USA, client-environment-type=Sandbox, AMSServerErrorCode=0, NSLocalizedDescription=No active account}

  2. [StoreKit] Did not receive any products or error for products request

I have a similar issue with the Simulator, but it works well on the device

Storekit sandbox accounts generating errors on device
 
 
Q