Question

I'm developing an iPad application that will be distributed "in-house" ie only inside enterprise. They asked me if i can produce 2 different releases of the same application to be installed on the same iPad.

The first one will communicate with a production server while the second will use a sandbox server and will be used by user to learn the system. Server url will be changed in app settings.

They told me to differentiate these releases by icon and title (and also, of course, by title in navigation bar). What's the best way to get this goal avoiding duplication of the project?

Was it helpful?

Solution

It sounds like you have 3 variables:

  • API address
  • Name
  • Icon

One idea might be to add a separate build configuration, call it something like "Sandbox". Here's an example of how to create a new build configuration. Then, have two separate Info.plist files specifying the "Bundle display name" and "Icon files". Copy your existing Info.plist and name it something like "Sandbox-Info.plist".

Then, in your project's settings, select the target (on the left) and the "Build Settings" tab. Search for "Info.plist File", and expand it. For the Sandbox entry (the name of build configuration you set earlier), change this entry to the Sandbox-Info.plist file you created.

This covers the name and icon settings. For the API address, search for "Other C Flags" in the "Build Settings" tab. Expand it. For each row, add a value like:

-DAPI_URI=@\"http://api.example.com\"

Vary this for the Sandbox entry to whatever your sandbox URI is.

Lastly, in your code, refer to API_URI as the string to your API address.

Hope this helps!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top