Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS In App Purchase: Will Apple reviewers test live or sandbox environment?

I use In App Payment to sell ingame consumables. After successfull payment I forward the payment receipt to my backend, which validates the receipt with the iTunes payment backend. This works flawlessly in the sandbox environment.

Now I submitted my app so it can be approved by the Apple guys and be published in the App Store. Of course I made sure that my backend will be validating the payment receipts with the production environment of the itunes backend, because I expected the Apple guys to test the app in production mode. However, the app was rejected. As a reason I was told that the purchase of my consumables does not work (refused by my backend because of an invalid receipt). After checking my logs I see 3 attempted purchases. I decoded the receipts that were used and see, that all of these are "environment" = "Sandbox".

Does this mean that Apple tests submitted apps in sandbox mode? That would be crazy! Am I supposed to allow sandbox payment in my production environment or what? Any facts about this?

like image 704
Thomas Hilbert Avatar asked Jul 31 '12 11:07

Thomas Hilbert


People also ask

Does Apple have sandbox?

The Apple sandbox environment lets you test in-app purchases on devices using product information set up in App Store Connect.

What is sandbox testing in iOS?

Overview. Use the Apple sandbox environment to test your implementation of in-app purchases that use the StoreKit framework on devices with real product information from App Store Connect. Your development-signed app uses the sandbox environment when you sign in to the App Store using a Sandbox Apple ID.

Do in app purchases work in TestFlight?

In‑app purchases in TestFlight use the sandbox environment, so they're free to testers and don't carry over into production once your app is released on the App Store. Once you've finished testing your in-app purchases, you can submit them for review.


2 Answers

Thomas, you should definitely read Apple's FAQ on In-App Purchase: https://developer.apple.com/library/content/technotes/tn2413/_index.html#//apple_ref/doc/uid/DTS40016228-CH1-RECEIPTURL

Always verify your receipt first with the production URL; proceed to verify with the sandbox URL if you receive a 21007 status code. Following this approach ensures that you do not have to switch between URLs while your application is being tested or reviewed in the sandbox or is live in the App Store.

So yes, they are kinda crazy. But we knew that, didn't we?

like image 122
janpio Avatar answered Sep 22 '22 21:09

janpio


@Jan P's answer is correct. If you're looking for a quick YES/NO answer, the specific answer from the FAQ is;

You should use the sandbox while your application is in review.

(15) What url should I use to verify my receipt ? Use the sandbox URL https://sandbox.itunes.apple.com/verifyReceipt while testing your application in the sandbox and while your application is in review.

like image 26
nspire Avatar answered Sep 20 '22 21:09

nspire