I implemented in app purchase in my iOS app and I want to do a real test (not a sandbox) before submitting this new version to Apple
Of course, the current version of the app (in the App Store) was validated with a product
So, I archived the app using an Ad Hoc distribution profile and I generated an IPA file for Ad Hoc deployment. But when I installed the app via Testflight on my device, I discovered that the app was in sandbox environment!
Is there a way to do a "real" purchase before submitting the app to the App Store ?
You can actually test the in-app purchasing in the sandbox environment, basically you'll need to set up an test user account in your iTunesConnect.
Check the apple documentation here:
http://developer.apple.com/library/ios/#technotes/tn2259/_index.html
You'll be able to find all the information related to In-App Purchasing, including sandbox testing.
Short answer: you can't test a real purchase (aka, spend real money). It isn't possible.
Slightly longer answer: You'll automatically hit the sandbox environment unless it's an apple-signed release build. Even ad-hoc signed builds hit the sandbox.
To test a new IAP: create your IAP (it will be in "needs approval mode" until submitted with the final build and test against the sandbox - that's fine). If your purchase works against the sandbox, it should work against prod with real money as well. It would be great to do a trial run with real money, but that's just not possible until the IAP is approved and you get the production signed version of the app from the app store.
Just create a test account on iTunes Connect. Then log out from the device and run your app from Xcode.
To get access to the purchase you need apple signature, because you are connecting with the apple servers.
I assume that your app, is doesnt have that signature, so your request goes to the sandbox.
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...
An iOS App has given for testing in TestFlight for testing In-App purchase
It used to test using the sandBox account, but now it's not working with sandBox and gets an error as “Your account has been disabled in the App Store and iTunes”.
Rechecked the product creation and checked the same - it's not worked.
Then created a new sandbox account and tried the same - its not worked, showed the same error.
Checked the issues in the web and from the related answers, tried to remove the account details from Settings --> iTunes & App Store - its not worked, showed the same error.
TestFlight users don't require a sandbox account, but they will test against an automatically created sandbox account.
This means it's no longer necessary to create test accounts in iTunes Connect.
Your TestFlight user is a legitimate App Store user, but doing in-app purchases made with beta builds are free within the context of the beta version.
More details available in the following section Testing in-app purchases with TestFlight by Marko Kruustük.
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.
Currently My app's Version 2.0 is live.
Recently I have uploaded version 2.1. I have made sandbox mode disabled from app which I am using for renewal subscriptions.
Now My app V2.1 is in waiting for review status. During this period when I am testing the app, it shows me [Environment:Sandbox] while testing In-App purchases.
I am trying to make in app purchase by downloading the app from test flight i.e. V2.1
V2.1 is in waiting for review mode and I am trying to restore my in app purchases with V2.1 which I already bought with V2.0.
Will this sandbox environment be disabled automatically by apple once the app is live?
Or there is anything I am missing?
Can anyone please help me out?
Thanks a lot in advance.
What you mean by "I have made sandbox mode disabled from app which I am using for renewal subscriptions."?
You won't get sandbox once you use app downloaded from AppStore. It's related to how the app is signed - test flight build is ad-hoc distributed which implies you get sandbox.
You can't disable sandbox in your app. Your provisioning profile will control which servers the IAP process looks at. You need to generate an app that's signed for Release to access the Prod IAP server.
I saw this question but its not what i need :- Testing in-app purchase after going live\
I want to provide limited set of testers free access to In App Purchase for testing purposes.The first version of app is live i wish to upload new version. What are my options?
I can make every thing free through code on development build and install it on testers device but i don't want to go this way.
Will the IAP test accounts work if one version of app is live already?
For Testing In-App purchase you have to login into your developer account and add Test user account for In-App purchase . Search for Sandbox In-App purchase testing and app you will get relevant steps.