I have been developing a tvOS app that uses in-app purchasing. As part of the development process, the app must be tested using iTunes sandbox user accounts. When beginning the in-app purchase using a local build, the user is prompted for the account credentials to one of these sandbox accounts.
The problem arises with tvOS 13, which does not appear to let you log out from or remove a sandbox account from the device once entered. While this might be okay for purchasing a single time, going through the purchase process again requires a new sandbox account, since otherwise, the purchase would be treated as a renewal rather than a new purchase.
Has anyone figured out a way to log out of a sandbox account with an Apple TV running tvOS 13? The only workaround I have found is to perform a reset on the device and go through the setup process again costing a great deal of time.
tvOS 13.4 (17L256) contains an update that allows you to sign out of the Sandbox account.
Settings > Users and Accounts > Scroll down to Sandbox Account > click on the email address > click Delete in the confirmation dialog > you're signed out 🎉
There is no way to log out on 13 OS . If you want to make a new purchase, just make sure you are logged out from AppleID (not sandbox). then if you make a new purchase within the app it will pop up to enter sandbox and will automatically replace old Sandbox with the new one
Related
We have recently updated several test devices from iOS 14.7.1 to 15.2. After that, when trying to make a test purchase inside our app, TestFlight ignores the sandbox accounts (which we add to Settings -> Apps-Store -> Sandbox account) and uses the main account that is used for purchases in the App Store.
The SandBox account works fine if you log out as the main user in the App Store - but then you can't use TestFlight to download test builds.
maybe someone has faced a similar problem and knows the solution or will tell me in which direction to look?
TestFlight ignores the sandbox accounts (which we add to Settings -> Apps-Store -> Sandbox account) and uses the main account
That is correct behavior. The sandbox account is for when you are running an Xcode build. TestFlight, on the other hand, always uses your real account, but it doesn't charge you (and the same for your beta testers).
#matt is right. The only what I can add here is that after you
logged in as sandbox user > attached device to xcode > run the build > made the purchase with sandbox user
you will be able to use that sandbox user even in next TestFlight builds.
For other testers this new approach is very uncomfortable, expecially if tester has a very complex password for their primary accounts... Apple made these things worst, for sure.
Btw, important to note that making purchases using primary account in sandbox environment (liek your testers do in TestFlight builds) will also reset the subscriptions in some time range. Not sure what exactly, probably from 5min to 1h. I didn't know it and had tons of questions, why my app doesn't recognise any previous subscription made recently. Purchase restore response also says that there is nothing to restore... Weird way of tasting, Apple...
I deleted on App Store Connect an old sandbox tester account xxx+yyy#zzz.com that was used for testing in app purchases and created a new one instead.
When trying to run my app on a device, I see this native dialog:
The only password that works is the one of the deleted account.
On the device's settings (iOS 13.4), under iTunes & App Stores, SANDBOX ACCOUNT is the NEW sandbox tester account.
I can't seem to sign out from the deleted account and use the new one for testing in app purchases.
This could indicate that you have unfinshed transations in your payment queue. Try if looping in paymentQueue(_, updatedTransactions:) through all transactions and calling finishTransaction() on them fixes your problem.
One of my iOS apps has been in the App Store for years, offering different non-consumable in-app purchase items.
Currently I am working on adding some new consumable items as well. Since the simulator does not support test purchasing I am running the test on my real device:
The device is running iOS 12. Within the system settings I have logged our from my real iTunes account and rebooted the device.
In AppStoreConnect I have created a new test user / iTunes Account and activated it
After installing the new app version on the device using Xcode 10 I started the process to restore previous purchases using [[SKPaymentQueue defaultQueue] restoreCompletedTransactions]
I expected that iOS would present an App Store login where I could use the credentials of the new test account. Instead paymentQueue:updatedTransactions: is called with different transactions in SKPaymentTransactionStateRestored state. I assume that these are the real transactions I made with my real App Store account some time ago.
How is this possible when being logged out from iTunes/App Store?
The result is the same, even when I login to the test account within the system settings, reboot the device run the restore process than.
Why are the transactions of my real account are restores while being logged in with another account (the test account)?
What can I do do force iOS to log out from my real account and use the test account instead?
Check Settings->iTunes & App Stores -> Scroll Down
here is SANDBOX ACCOUNT log out sandbox account too and everything will work
I developed a Phonegap iOS app that implements In app purchase. As suggested here, I used a sandbox user in order to test the IAP during the development process in iOS, but i can not find a way to switch back to my personal account to authenticate the application.
At the start of the development process, i signed out with my personal account, i didn't login with my sandbox user in General > iTunes & App Store, i started the application and i logged in with my sandbox user from that.
It is time now to pass to production and i can not figure out how to logout the sand box user from my app. If i start the application a Sign In popup is displayed and the sandbox email is there. It simply ask for the password but now chance to change the account. When i login within the application the sandbox user account is logged in General > iTunes & App Store, but if i log out from there the application is stuck with the sandbox email. In other words, it is like if the app is now linked to that email account and it does not give me the chance to change it.
I tried to remove the application (tapping on it and pressing the X button and from General > Manage storage), install it again, to soft reset the iPhone, log out from iTunes & App Store, rebuild the application in debug mode or not, including the plugin or not, in many combination but with no success.
Does anybody experienced something like this? How did you logout your sandbox user when you switched back to your personal iTunes Connect account?
I'm not sure how it looks like on previous iOS versions, but on iOS 12.0 you can open:
Settings > Your Name (Apple ID, iCloud & App Store) > iTunes & App Store
There you will find a section called "SANDBOX ACCOUNT" where you can sign out of the sandbox account you've been using.
On iOS 14 & 15:
Go to Settings > App Store
Scroll down until the end and you'll find the title "SANDBOX ACCOUNT", there you'll see the sandbox account you are currently logged in to, tap over it and it will let you change it.
I have found 2 ways to avoid the problem but first be sure to use a "fresh" testing account.
Change the Bundle Identifier in Xcode and iTunes Connect
Restore the iPhone
I go for the first one because my Testing device is also my personal iPhone and I can't afford restoring every week.
I spent so much time on that so I hope my answer can help you.
I'm trying to make in-app (non-consumable) in my app.
I'm trying to buy the package but I can't...
Of course, I've looked here for answer, but I have one actual account everywhere - at developer.apple.com - also I've created provisioning profiles, at itunesconnect.apple.com and in Xcode as well...
My bundle identifier is the same across the all websites and application.
The Application finds my package and show me the price of it. When I click on BUY the alert view show the text:
You are not authorized to make purchases of this InApp in Sandbox at this time.
[Environment: Sandbox]
Any ideas please?
You can use In-App purchase test users, to test In-App purchase in sandbox mode.
Create test users in the "Users and Access" section of appstoreconnect.apple.com
Before testing In-App purchase, Using the Settings app, logout your actual Apple ID and login the test user account directly via your app. (DON'T login the test user via Settings app or AppStore.)
They used to have the real iTunes login and the Sandbox iTunes login grouped back in 2017. So you would sign in to your Sandbox account while testing purchases in the app, and then it would change your iTunes login as well. Then you'd have to sign out of your iTunes through settings. Now they have a separate field on the bottom of the Settings --> Itunes & App Stores screen (called "Sandbox Account"). You have to sign in there with a provisioned Sandbox account which is added in "Users & Access" in App Store Connect. (You have to also verify that email address, and it can not use a +postfix on the email address, IF that email is used as one of your non-sandbox main accounts... Sigh...) So you have to actually create new unique emails now that are not used as part of your main accounts. (From my understanding you can still use +postfixes on your emails which are only used for sandbox accounts though :)
Now, there's still a bug with purchases where If you are not signed in with your main Itunes account, OR your sandbox account, and you try to test purchases by typing in a sandbox account (in the app), it will keep asking you for your Sandbox Email / Password over and over again, Until you type in your REAL iTunes account as well (????). That works (typing in both the sandbox account and the real itunes account). Then the sandbox purchase goes through. I'm as surprised as you are...
If your apple account has a sandbox account user, after logging in with your account, follow these steps
Step 1 : Go to settings.
Step 2 : Select iTunes & Settings
Step 3 : Scroll to the bottom. There is a section for SANDBOX ACCOUNT
Step 4 : Sign in there using your Sandbox account
Now test your app & it will work fine.
First create a new account on sandbox which is on iTunes -> Users and access -> on left hand side click on sandbox and add account on it.
And then go to your testing device
Sign out previous id from Sandbox Account and click to add a new sandbox id which have added on Sandbox tester.
Thank you!
I have multiple Apple development organizations associated to my account on App Store Connect. The reason I was getting this error was because my Sandbox Tester was created in an organization that wasn't associated with the app I was testing.
I swear the organization was right when I was adding the Sandbox user, but I can't be sure. It never hurts to refresh App Store Connect an extra time and double check the Sandbox Tester is in the correct organization.
I had this issue as well when I accidentally tried to make an in app purchase on our TestFlight app using sandbox account credentials created in the App Store connect Sandbox Testers section. So if you are experiencing this issue just make sure you are using sandbox account credentials for your dev or staging apps. With the TestFlight app version you should use your real Apple ID credentials (you won't be charged of course as TestFlight still uses the Sandbox environment for in-app purchases).
For more information checkout https://developer.apple.com/documentation/storekit/original_api_for_in-app_purchase/testing_at_all_stages_of_development_with_xcode_and_sandbox
https://developer.apple.com/documentation/storekit/in-app_purchase/testing_in-app_purchases_with_sandbox
Try this check-list
Create test user #App Store Connect > "Users and Access" section. (Apple Doc - https://help.apple.com/app-store-connect/#/dev8b997bee1)
Logout older sandbox id from App Store & login new sandbox id, here is the steps for iOS & macOS
iOS: Open "Settings" > "App Store" > "SANDBOX ACCOUNT" (will be at bottom of screen)
macOS: Open "App Store" app > "Preferences.." > "Sandbox Account" section will be at bottom
First,make sure the account of your in test app is right.
Second,when you are working in the app,click the recharge button,and input the right account for testing.