TestFlight In App Purchase Not In Sandbox - ios

I'm currently a beta tester (Internal Tester) for an application we are building for IOS.
We are having some issues with the in app purchase section of the application however it hasn't been consistent across all devices.
My college has an iPhone X and I have an iPhone 7 and we both run into the same issue.
No matter how we are signed into the sandbox account (or not signed in; or turned off the device while signed in; or using a new account and only signing in when on the application) we receive the same popup when trying to test an in app purchase.
The popup is missing one "Environment [Sandbox]"

This alert comes if you try to purchase sandbox product with real account credentials or vice versa.
Try below things -
Delete the app.
Logout from iTunes and iCloud.
Restart the phone and make sure you have logged out of your real account.
Your app must be archived with debug mode only. Production signed build with Adhoc/Release won't work with sandbox mode.

Related

Can't sign out of non existing sandbox account iOS 13.4

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.

Removing sandbox accounts from tvOS 13

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

iOS restores in-app purchase although no iTunes account is logged in

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

how to switch from Sandbox to live in In App purchase

I am using In App purchase and it is working fine when i am testing it from the sandbox account. But when i tried to purchase the online subscription by making amount zero by live account. it is giving an error of
[you are not authorised to make purchase in this inApp in SandBox at this time Environment Sandbox]
i guess it was setup in sand box mode. So As i tested in sandbox and it is working fine ho can i make it live to that any one can purchase it.
I got my answer for the apple document that app installed from Xcode is always in Sandbox environment and app download from live itunes is Live. thanks a lot to all and specially for one who commented heae on post and guided me.
=>
StoreKit connects to the sandbox environment when you launch your application from Xcode, from your test device (iOS), or from the Finder (OS X). It connects to a production environment for applications that were downloaded from the App Store. You must not use your test user account to sign into the production environment. This will result in your test user account becoming invalid. Invalid test accounts cannot be used to test In-App Purchase again.
<=
Apple Document
You can not test live app with sandbox test ID as sandbox email ID has no real credit. If In App Purchase is working for sandbox ID, it will work for real IDs too.

Using sandbox user to test In App Purchase

When I test my Cordova app (with cordova-plugin-purchase) all in app product IDs are reported invalid.
I tried to restore purchase (which calls store.refresh()) and a login prompt appeared. I log in with sandbox account but it asks for my billing information which it shouldn't. How do I test this app correctly?
Things I have tried:
Sign out from iOS App Store
Close iTunes on my Mac
Uninstall app, restart the phone, reinstall app
Install app via Xcode
Create a fresh sandbox user in US region
I never use sandbox account to sign in in the App Store application or in the iOS settings. I also never verified its email.
About my app's environment:
I have completed paid apps contract
The app is waiting for review submission
The binary is signed with developer key
One in app product is waiting for review submission, others are waiting for screenshot
All in app products are consumable
I have tested the code on Android and it is working correctly. I used same product ID in iTunes connect as in Play Store.
I noticed that app produces sandbox push notification token
The devices tested are an iPhone 4 running iOS 6 and a jailbroken iPad 2 running iOS 6

Resources