seaders
seaders

Reputation: 4106

Is there a way to refer to the CFBundleIdentifier elsewhere in the Info.plist file?

For our game, in the Info.plist file, our CFBundleIdentifier is set as,

<key>CFBundleIdentifier</key>
<string>com.sixminute.$(PRODUCT_NAME:rfc1034identifier)</string>

But then, for Google Play Sign in, we need the following URL Types in CFBundleURLTypes,

        <key>CFBundleURLName</key>
        <string>com.sixminute.$(PRODUCT_NAME:rfc1034identifier)</string>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>com.sixminute.$(PRODUCT_NAME:rfc1034identifier)</string>
        </array>

is there any way we could instead reference the CFBundleIdentifier dynamically like $(BUNDLE_IDENTIFIER) or similar?

Upvotes: 0

Views: 557

Answers (2)

Trident
Trident

Reputation: 832

you can not dynamically update CFBundleIdentifier later(or programmatically) and you can only add value to it compile time. Your question is also not clear, if you are referring something else.

BTW, CFBundleIdentifier and CFBundleURLName/CFBundleURLSchemes are completely orthogonal.

Upvotes: 0

cdescours
cdescours

Reputation: 6022

You can define user-variables in XCode in your target properties by following these steps :

  1. Go to "Build settings" of your target app
  2. Select Menu "Editor"-> "Add Build Setting" -> "Add User-Defined Setting"
  3. Name your variable (e.g. "BundleId") and its value for each configurations

Then in your plist file you can simply use :

<key>CFBundleIdentifier</key>
<string>${BundleId}</string>

Upvotes: 5

Related Questions