I have two different environments setup in on target (one for development and another for production), because of that i want to use two different GoogleService-Info.plist but still without success. Is there a way to do it?
In the Xcode project navigator, select the app target. Switch to the Build Phases tab at the top, then add a New Run Script Phase. Name the phase “Setup Firebase Environment GoogleService-Info. plist”, or something to that effect, and place it before the “Copy Bundle Resources” step.
Right click on the folder you want to add it to and choose "New file…" This will bring up a blank file with columns for Key, Type and Value. Choose any of the presented options, you'll be overwriting it anyway. Now change the Key to "Apple".
I use the following solution:
Create a GoogleService-CONFIGURATION-Info.plist file for every XCode configuration. Don't link the files to a target.
Add a Run Script Build Phase:
cp ${SRCROOT}/Resources/Firebase/GoogleService-${CONFIGURATION}-Info.plist ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GoogleService-Info.plist
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With