Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

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 ?

like image 893
Safouane Azzabi Avatar asked Nov 21 '12 16:11

Safouane Azzabi


People also ask

How do I validate a receipt for an in app purchase?

There are two ways to verify a receipt's authenticity: Local, on-device receipt validation, best for validating the signature of the receipt for apps with in-app purchases. Server-side receipt validation with the App Store, best for persisting in-app purchases to maintain and manage purchase records.

How do I verify In app purchases Apple?

Use the production URL https://buy.itunes.apple.com/verifyReceipt when your app is live in the App Store. For more information on these endpoints, see verifyReceipt. Verify your receipt first with the production URL; then verify with the sandbox URL if you receive a 21007 status code.

How do I test in app purchases in TestFlight?

you can test in-app purchase with test account. then create an account for testing your in app purchase. when test in app purchase try to logout from app store which uses your real account. then it will ask for itunes account while in testing in app purchase then enter your test account credentials.


2 Answers

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.

like image 56
meim Avatar answered Sep 30 '22 13:09

meim


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.

like image 26
scosman Avatar answered Sep 30 '22 13:09

scosman