Using sandbox user to test In App Purchase - ios

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

Related

In-app purchase asks every time to sign-in Apple ID and password on IPAD specifically when installed from test flight

My app's IAP works fine on local build for iPhones and IPAD for iOS 15.1 but when I upload it on a test flight, it keeps on displaying enter apple id and password even I have signed into it on the app store using a sandbox account.
This problem occurs only on iPad iOS 15.1 and works fine for every other device that too when I install the app from a test flight. When I take a local build from Xcode, the issue does not happen.
Use your real account not the sandbox for TestFlight

TestFlight In App Purchase Not In Sandbox

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.

How do I test In-App Purchase in iOS 12 using sandbox account?

I am no longer able to test In-App Purchases with Simulator for iOS 12. I didn't have this problem before.
The instructions say for me to log out of iTunes and App Store in Settings, and when I test the In-App Purchase, iOS would ask me for an Apple ID. I have done that, but iOS never asks for an Apple ID. Instead I get an error object in my code that says "Cannot connect to iTunes Store". (It doesn't terminate the app. I was able to successfully print the description of the error object in the debug window.)
When I try to put my sandbox account in the iTunes and App Store account setting, I get a message that says, "There was a problem connecting to the server."
You can display IAP products on both the iOS simulator as well as physical iOS devices, but to test buying or restoring purchases you've always needed a physical device.
On iOS 12, you can set a default sandbox user in Settings -> Your Account -> iTunes & App Store -> Sandbox Account. This can help out with the sign in prompts and save your phone from having to change accounts repeatedly.

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

Unable to complete Apple in App purchase in sandbox mode? Payment Verification

I am using the Titanium Storekit module to setup in App purchases on my App. The code all seems to be working from an example so I created a test account for the app and then went into the App Store settings and changed my app store account to this new id, iPhone 4s iOS7 latest build. I entered valid credit card information and even completed a purchase to get rid of the payment verification.
In my app which is running in sandbox mode i click to make a purchase, then i login to my account and it switches to iTunes stating sandbox mode. It then asks me to verify my payment information, which i have done already in the app store, then asks for my login again. Then it just repeats the message sandbox mode, login and payment details.
I just can't get it to go through as a purchase?
I used this example for the Ti.Storekit
https://gist.github.com/dawsontoth/1448587

Resources