I have an Xcode project that builds into a few different apps (whitelabels) using different configurations.
For a new payment method I need each app to have a unique CFBundleURLScheme
.
I wrote the following "Run Script" that is before Compile Sources
in "Build Phases".
INFO_PLIST="${PROJECT_DIR}/${INFOPLIST_FILE}"
plutil -insert CFBundleURLTypes.0.CFBundleURLSchemes.0 -string "swish${PRODUCT_BUNDLE_IDENTIFIER//.}" $INFO_PLIST
This adds the value swishourbundleidentifier
. (So, swish + our.bundle.identifier
, but without the dots)
This currently changes the actual Info.plist. What I want is that it changes the Info.plist that's in the folder where the app is built to, so that it is overridden each time (so there are no double values) and that the added value doesn't show up in git.
How would I go about that? I guess it's simply changing "${PROJECT_DIR}/${INFOPLIST_FILE}"
, but to what?
If any more information is needed, please let me know.
EDIT: Actually, if it is possible, a better solution would be to add something like swish${PRODUCT_BUNDLE_IDENTIFIER//.}
in the Info.plist
's URL Schemes. So that it's compiled to that on build time, but no double values. I tried this but it doesn't seem to work like that unfortunately.