Question

I have a project where I have a few apps which share a single Info.plist file. I have been trying to set a custom URL scheme for them individually. I have been looking at variable names like ${SOME_NAME}. I would like to know how I can create a variable named URL_SCHEME, which I can access in my Info.plist file like so ${URL_SCHEME}, thus avoiding the need to create individual ones for each app. Can anybody point me in the right direction?

Was it helpful?

Solution

You can pre-process Info.plist files with values from a header file.

  1. Create a header file with appropriate #define statements.
  2. In your app's build settings, set Preprocess Info.plist File to YES.
  3. In your app's build settings, set Info.plist Preprocessor Prefix File to the path to the header file you created in #1.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top