views:

105

answers:

3

At runtime in an iphone app, is there a way to distinguish the distribution type programatically between ad hoc and app store? Whenever I do an ad hoc distribution I want to target internal test servers for web service end points, then for the app store distribution target the production servers.

Thanks. Jim

A: 

I don't think that info is available to your app. But you could do this by using different preprocessor #defines for the different Build configs and then define your constants based on the values of these #defines.

Ole Begemann
A: 

I don't think there is a way to determine the distribution type as they would just be the same binary but supplied a different way. I would make a separate build for your ad hoc and change what you need to point it to your internal test servers.

rooster117
+1  A: 

You can. Open the file embedded.mobileprovision file in your application bundle (you can do this programatically, of course) and check for <key>ProvisionedDevices</key>. It's only there in the Ad Hoc copy of your app, as long as you did sign the App Store version with an App Store provisioning profile.

MrMage