SwiftyStoreKit icon indicating copy to clipboard operation
SwiftyStoreKit copied to clipboard

No auth plugin to verify credentials for accounts of type com.apple.account.iTunesStore.sandbox

Open ServusJon opened this issue 3 years ago • 10 comments

I always get an error when trying to fetch prices of auto renewable subscriptions. Any idea?

  • I don't use the sharedsecret in my code currently.

ServusJon avatar Jul 01 '21 14:07 ServusJon

When I use a local storekit file it all works fine. I only get the issues when I try to use the submitted in app purchases

ServusJon avatar Jul 01 '21 14:07 ServusJon

<SKReceiptRefreshRequest: 0x6000015ce980>: Finished refreshing receipt with error: Error Domain=ASDErrorDomain Code=500 "Unhandled exception" UserInfo={NSUnderlyingError=0x600001b3dfb0 {Error Domain=AMSErrorDomain Code=100 "Authentication Failed" UserInfo={NSLocalizedFailureReason=The verify credentials call failed., NSLocalizedDescription=Authentication Failed, NSUnderlyingError=0x600001b3c510 {Error Domain=com.apple.accounts Code=4 "No auth plugin to verify credentials for accounts of type com.apple.account.iTunesStore.sandbox" UserInfo={NSLocalizedDescription=No auth plugin to verify credentials for accounts of type com.apple.account.iTunesStore.sandbox}}}}, NSLocalizedFailureReason=An unknown error occurred, NSLocalizedDescription=Unhandled exception}

ServusJon avatar Jul 01 '21 14:07 ServusJon

I'm facing the same issue. Did anybody figured it out ?

Haris2v avatar Mar 02 '23 06:03 Haris2v

Getting a similar error now on an iOS simulator trying to test sandbox payments with expo and revenue cat. Not sure if related.

[StoreKit] <SKPaymentQueue: 0x6000021006a0>: Payment completed with
error: Error Domain=ASDErrorDomain Code=500 "Unhandled exception"
UserInfo={NSUnderlyingError=0x600002d34c00 {Error Domain=AMSErrorDomain
Code=100 "Authentication Failed"
UserInfo={NSMultipleUnderlyingErrorsKey=(
"Error Domain=AMSErrorDomain Code=2 \"An unknown error occurred. Please
try again.\" UserInfo={NSLocalizedDescription=An unknown error occurred.
Please try again.}",
"Error Domain=com.apple.accounts Code=4 \"No auth plugin to verify
credentials for accounts of type com.apple.account.iTunesStore.sandbox\"
UserInfo={NSLocalizedDescription=No auth plugin to verify credentials
for accounts of type com.apple.account.iTunesStore.sandbox}"
), NSLocalizedDescription=Authentication Failed,
NSLocalizedFailureReason=The authentication failed.}},
storefront-country-code=USA, client-environment-type=Sandbox,
AMSServerErrorCode=0, NSLocalizedFailureReason=An unknown error
occurred, NSLocalizedDescription=Unhandled exception}
[StoreKit] <SKPaymentQueue: 0x6000021006a0>: Payment completed with
error: Error Domain=ASDErrorDomain Code=500 "Unhandled exception"
UserInfo={NSUnderlyingError=0x600002d31980 {Error Domain=AMSErrorDomain
Code=100 "Authentication Failed"
UserInfo={NSMultipleUnderlyingErrorsKey=(
"Error Domain=AMSErrorDomain Code=2 \"An unknown error occurred. Please
try again.\" UserInfo={NSLocalizedDescription=An unknown error occurred.
Please try again.}",
"Error Domain=com.apple.accounts Code=4 \"No auth plugin to verify
credentials for accounts of type com.apple.account.iTunesStore.sandbox\"
UserInfo={NSLocalizedDescription=No auth plugin to verify credentials
for accounts of type com.apple.account.iTunesStore.sandbox}"
), NSLocalizedDescription=Authentication Failed,
NSLocalizedFailureReason=The authentication failed.}},
storefront-country-code=USA, client-environment-type=Sandbox,
AMSServerErrorCode=0, NSLocalizedFailureReason=An unknown error
occurred, NSLocalizedDescription=Unhandled exception}

visaals avatar Mar 02 '23 19:03 visaals

I just figure out how to resolve this issue: Open xcodeworkspace file in xCode. File -> New -> File -> StorekitConfiguration File. Give a name to this file. And click on sync. Select correct team and app and save anywhere in your project.

Now Got to Product -> Scheme -> Edit Scheme. Select run from the left and click on options menu and choose that saved file for StoreKit configuration field.

Run the app using xCode. I believe this will fix your issue

Haris2v avatar Mar 03 '23 17:03 Haris2v

Facing a similar issue, wasn't able to get to the root of it yet

Same setup, using Revenue Cat. Created a StoreKit configuration file pretty much as instructed by the docs. Tried both ways, a local StoreKit file and a synced file, added it to a new scheme and built with that

Created sandbox users on appstore connect, logged in with those users into iCloud.com on device to go through the accept terms process. Tried using those sandbox users within Simulator (not physical device) to purchase something

[StoreKit] <SKPaymentQueue: 0x600003f7e7b0>: Payment completed with error: Error Domain=ASDErrorDomain Code=500 "(null)"
UserInfo={client-environment-type=Sandbox, storefront-country-code=USA, NSUnderlyingError=0x600003179050 {Error
Domain=AMSErrorDomain Code=100 "Authentication Failed" UserInfo={NSMultipleUnderlyingErrorsKey=(
"Error Domain=AMSErrorDomain Code=2 \"An unknown error occurred. Please try again.\" UserInfo={NSLocalizedDescription=An
unknown error occurred. Please try again.}",
"Error Domain=com.apple.accounts Code=4 \"No auth plugin to verify credentials for accounts of type
com.apple.account.iTunesStore.sandbox\" UserInfo={NSLocalizedDescription=No auth plugin to verify credentials for accounts of
type com.apple.account.iTunesStore.sandbox}"
), NSLocalizedDescription=Authentication Failed, NSLocalizedFailureReason=The authentication failed.}}}

My IAP is not live yet, just prepared in the app submission and configured within Revenue Cat. It fetches those just fine, just the sandbox stuff and testing isn't working.

@visaals did you figure out what was causing your issue?

dvcrn avatar Jun 02 '23 10:06 dvcrn

@dvcrn Have you tried this ?

Haris2v avatar Jun 02 '23 12:06 Haris2v

Yes, both with an automatically synced StoreKit file, and with a local file. Both didn't do it for me after including them into the building scheme

dvcrn avatar Jun 03 '23 04:06 dvcrn

@dvcrn Please open xCode, click on product from top menu and do a 'Clean Build Folder'. After that verify again that you have successfully added store configuration file, recheck this comment if needed. And the most important thing is you need to run your app through xCode for the first time. And then you can install you app using Android Studio or VS code or whatever IDE you use. This test purchase feature will work unless and until you keep your app installed, once uninstalled you again need to run your app from xCode.

In very short, run your app from xCode in order to test in-app-purchases. I hope this will help :)

Haris2v avatar Jun 05 '23 06:06 Haris2v

Got it working, the trick was indeed to do a manual xcode build, and not through xcodebuild or eas/expo 👍

dvcrn avatar Jun 06 '23 04:06 dvcrn