views:

149

answers:

2

I was wondering if there was a way within an app code to determine if the app is real (in the iTunes store) versus test? The reason is that I have every part of in app purchase resolved. However when verifying the receipt you must send it to either https://buy.itunes.apple.com/verifyReceipt if live or https://sandbox.itunes.apple.com/verifyReceipt if just a test.

Currently I switch the setting prior to submission but I know such an approach can easily fail with a sandbox version being submitted by accident. I would like the code to determine which URL to use.

+2  A: 

You could have it set using some #ifdefs and the different build configurations Xcode can create (i.e. debug vs. release vs. distribution).

refulgentis
+2  A: 

You should use a #define APP_STORE, or something like that, and check with #ifdef. Then, in your build script to build your app store submission from scratch (you do have a one-step build script, right?), just have it automatically define APP_STORE, and you'll never forget.

Jesse Beder
Thanks, I will look into using a one-step build script.
dredful