I cannot sign in with Sandbox tester ID (the fields are not even displayed in Settings-App Store).
I am running Xcode 14.2 and attempting to test on a developer-signed physical device (iOS 16.1.2). Following the steps in Apple documentation ("Setting up StoreKit Testing in Xcode"), I have been able to run tests using using local StoreKit configuration file. All works well. I next wanted to try to use Sandbox Testing. Following the same documentation,
I set up a Sandbox Tester in Apple Store Connect.
I saved a Public Certificate from the storekit configuration file in the project.
I removed the local StoreKit configuration file from the scheme’s run options (by setting to "none").
I added the following conditional compilation block to my store manager:
#if DEBUG let certificate = "StoreKitTestCertificate" #else let certificate = "AppleIncRootCertificate" #endif
It is my understanding that an option to sign in with the SandBox ID should appear in device's App Store Settings after the first time I attempt to make a purchase when running on the device physically connected to my Mac. This is not happening. Am I missing a step? One possible mistake I made was placing the (above) conditional compilation block in the wrong place. Can someone recommend the best place for this? The documentation says to paste it in with my receipt validation code. Another suspected oversight might be something else I need to do in Apple Store Connect. Not sure. Any help appreciated! Addendum - I get this message in the console:
Error enumerating unfinished transactions for first transaction listener: Error Domain=ASDErrorDomain Code=509 "No active account" UserInfo={storefront-country-code=USA, client-environment-type=Sandbox, AMSServerErrorCode=0, NSLocalizedDescription=No active account}
I had an issue while attempting to test my product using a sandbox account, and it took me a few hours to troubleshoot and find a solution. Here's what ultimately helped me get it working while building from Xcode:
Error Domain=ASDErrorDomain Code=509 "No active account"By following these steps, I was able to successfully view the in-app purchase product and conduct tests using the sandbox environment.