iOS In App Purchase: test a real purchase without submitting to Apple
Asked Answered
B

4

28

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 ?

Betulaceous answered 21/11, 2012 at 16:45 Comment(0)
E
27

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.

Explicable answered 22/11, 2012 at 0:48 Comment(6)
I did that ! What I want, is to do a real test; I mean testing a real purchase with a real iTunes user. What I try to avoid, is to discover, when the app is in the app store, that the IAP doesn't work!Betulaceous
If the IAP works for your test account in the iTunesConnect, it will work for a real iTunes user when it's released in the app store.There's no way to use a real iTunes user to test IAP.Explicable
@Shadowfiend, I certainly hope what you said is true. I'm having a problem with an app that comes with IAP which works well in development stage, but not real case after released for sell. Here is my case: #13574537Patti
Is there a way to set up a test user account without giving a valid credit card?Werner
yes: setup your test account on iTunesConnect (no credit card needed), then logout from your actual account in the App Store app on your iOS device. Do not log back in with your test account in the App Store app. Go in your app and process with the purchase; only log in there when asked for your credentials. You won't need a credit card.Fireproofing
Now you can login into sandbox user account from settings without signing out from real account :)Somewhere
B
18

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.

Blackness answered 6/2, 2015 at 16:56 Comment(0)
B
4

Just create a test account on iTunes Connect. Then log out from the device and run your app from Xcode.

Beekeeping answered 10/5, 2014 at 4:47 Comment(0)
R
1

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.

Rodrickrodrigez answered 21/11, 2012 at 16:56 Comment(3)
how can I get the apple signature?Betulaceous
I don't understand what do you mean by signatureBetulaceous
@StefanoDjerbiano - did this test of an in-app purchase (prior to app submission) ever work out for you? Im wanting to do the same and am not quite sure how to approach it. thanksScleritis

© 2022 - 2024 — McMap. All rights reserved.