Craig-Ronald / capacitor-subscriptions

MIT License
14 stars 5 forks source link

Error - No delegate to perform authentication #8

Open selcukbeyhan opened 9 months ago

selcukbeyhan commented 9 months ago

Hi, I am using the Sandbox for testing and receive following error. There is not much details in the logs. What can be the reason and the fix for this please?

Thanks

Error enumerating unfinished transactions: Error Domain=ASDErrorDomain Code=500 "(null)" UserInfo={NSUnderlyingError=0x600000c5aa90 {Error Domain=AMSErrorDomain Code=2 "Finance Authentication Error" UserInfo={NSLocalizedDescription=Finance Authentication Error, AMSURL=https://mzstorekit-sb.itunes.apple.com/inApps/v1/history?guid=48473C4CBB92&reason=initial, AMSStatusCode=401, NSLocalizedFailureReason=No delegate to perform authentication: <AMSAuthenticateRequest: 0x600000c615c0> { account = test1.sandbox@mydomain.com(84FB86FA-B570-47CF-894C-263B7B5DA03D), logKey = 0E11B0CB, options = <AMSAuthenticateOptions: 0x600003b187e0> { AMSAuthenticateOptionsAllowPasswordGeneration = 0, AMSAuthenticateOptionsAllowSecondaryCredentialSource = 0, AMSAuthenticateOptionsAllowServerDialogs = 0, AMSAuthenticateOptionsAuthenticationTypeKey = 1, AMSAuthenticateOptionsCanMakeAccountActiveKey = 0, AMSAuthenticateOptionsClientInfo = {length = 982, bytes = 0x62706c69 73743030 d4010203 04050607 ... 00000000 0000033c }, AMSAuthenticateOptionsCredentialSourceKey = 0, AMSAuthenticateOptionsDebugReason = no dialogResponse in AMSFinanceAuthenticateResponse, AMSAuthenticateOptionsDelegateAuthEnabledKey = 0, AMSAuthenticateOptionsEnableAccountCreationKey = 0, AMSAuthenticateOptionsEphemeralKey = 0, AMSAuthenticateOptionsForceSyncToPairedWatchKey = 0, AMSAuthenticateOptionsIgnoreAccountConversion = 0, AMSAuthenticateOptionsLogKeyKey = 0E11B0CB, AMSAuthenticateOptionsRemoteProxyAuthenticationKey = 0, AMSAuthenticateOptionsServiceTokenOnly = 0, AMSAuthenticateOptionsServiceType = 2, }, }}}, storefront-country-code=SGP, client-environment-type=Sandbox}

CraigRonald555 commented 9 months ago

Hi, I am using the Sandbox for testing and receive following error. There is not much details in the logs. What can be the reason and the fix for this please?

Thanks

Error enumerating unfinished transactions: Error Domain=ASDErrorDomain Code=500 "(null)" UserInfo={NSUnderlyingError=0x600000c5aa90 {Error Domain=AMSErrorDomain Code=2 "Finance Authentication Error" UserInfo={NSLocalizedDescription=Finance Authentication Error, AMSURL=https://mzstorekit-sb.itunes.apple.com/inApps/v1/history?guid=48473C4CBB92&reason=initial, AMSStatusCode=401, NSLocalizedFailureReason=No delegate to perform authentication: <AMSAuthenticateRequest: 0x600000c615c0> { account = test1.sandbox@mydomain.com(84FB86FA-B570-47CF-894C-263B7B5DA03D), logKey = 0E11B0CB, options = <AMSAuthenticateOptions: 0x600003b187e0> { AMSAuthenticateOptionsAllowPasswordGeneration = 0, AMSAuthenticateOptionsAllowSecondaryCredentialSource = 0, AMSAuthenticateOptionsAllowServerDialogs = 0, AMSAuthenticateOptionsAuthenticationTypeKey = 1, AMSAuthenticateOptionsCanMakeAccountActiveKey = 0, AMSAuthenticateOptionsClientInfo = {length = 982, bytes = 0x62706c69 73743030 d4010203 04050607 ... 00000000 0000033c }, AMSAuthenticateOptionsCredentialSourceKey = 0, AMSAuthenticateOptionsDebugReason = no dialogResponse in AMSFinanceAuthenticateResponse, AMSAuthenticateOptionsDelegateAuthEnabledKey = 0, AMSAuthenticateOptionsEnableAccountCreationKey = 0, AMSAuthenticateOptionsEphemeralKey = 0, AMSAuthenticateOptionsForceSyncToPairedWatchKey = 0, AMSAuthenticateOptionsIgnoreAccountConversion = 0, AMSAuthenticateOptionsLogKeyKey = 0E11B0CB, AMSAuthenticateOptionsRemoteProxyAuthenticationKey = 0, AMSAuthenticateOptionsServiceTokenOnly = 0, AMSAuthenticateOptionsServiceType = 2, }, }}}, storefront-country-code=SGP, client-environment-type=Sandbox}

Do you have a pending license agreement in your Developer account? And have you uploaded an initial build to TestFlight?

I did a bit of research and people who seem to have this problem are on XCode 14.1 or 14.2, if you’re on either of these versions, you could try updating that too.

selcukbeyhan commented 9 months ago

No, I do not have pending license agreement. I am testing via emulator iOS 17.2 with XCode 15.2.

On my emulator, I didnt login with any Apple account. During purchase, the application asks credentials to trigger the purchase. I provide the details of the sandbox account.

selcukbeyhan commented 9 months ago

No, I do not have pending license agreement. I am testing via emulator iOS 17.2 with XCode 15.2.

On my emulator, I didnt login with any Apple account. During purchase, the application asks credentials to trigger the purchase. I provide the details of the sandbox account.

After some research I came across to this page in Apple: https://forums.developer.apple.com/forums/thread/723153

Via the referenced blog entry there I realised for testing on sandbox platform, one needs to test on the device: https://developer.apple.com/documentation/storekit/in-app_purchase/testing_in-app_purchases_with_sandbox?language=objc

When I tested the app on the device, this error didnt appear at all.

For the record (could be helpful for others): a) I was testing the app on my personal device. My device has my Apple ID activated. b) The purchase I conducted was with the sandbox account. c) When I re-open the app, it detects the transactions conducted via sandbox account. d) The response from the plugin doesnt seem to include with which account the purchase was associated --> Is this a limitation of the Apple or from the Plugin side? Can this be enhanced?