I have a Flutter Project, I have created two separate firebase projects(not two apps in same firebase project). I am setting two different schemes for my iOS app. I have following commands to use different projects accordingly
1.flutter run --release --flavor prod
2.flutter run --release --flavor dev
For dev flavour it need to use the dev project created in firebase but it uses the production firebase project and vice versa.
The configuration works properly for Android and not for iOS.
I am following the below tutorials for iOS setup
https://www.tengio.com/blog/multiple-firebase-environments-with-flutter/ https://www.youtube.com/watch?v=gdqnxcV7_FY&feature=emb_logo
As you can see below image for how I have setup my Google services file. I have checked many times and I am not mismatching those files by putting prod in dev and vice versa.
Following is my script
I have also added the Google services file to targets. I tried removing the checkmark of targets as well for Google services file but still same issue.
One thing I noticed is that if I add the prod google services file after the dev google services file to my iOS project it always use the prod environment irrespective of flavor. If I add dev after prod then it uses dev environment of firebase irrespective of flavor. Even changing the command line build options in xcode does not work for me.
GoogleService-Info.plist
must be on project's root directory.
Move all GoogleService-Info.plist
to project's root, change their name. for example add scheme to the name like GoogleService-Info-prod.plist
and change your command to
cp -r "$PATH_TO_GOOGLE_PLISTS/GoogleService-Info-prod.plist" "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/GoogleService-Info.plist"
do this for all schemes
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