Closed dancamdev closed 1 year ago
Refer to #132
PR has been merged but is not available on the stable version on the pub. But you can use the pre-release version of flutter_fire_cli to achieve this use case.
New command line arguments has been added. --android-out=/android/google-services.json (Here you can specify the custom file name) --ios-out=/ios/GoogleService-Info.plist (Here you can specify the custom file name)
Refer to #132 for more information.
I'm going to remove the method for renaming the file in a future release. Both iOS and android require the name of the file to match their standard naming. i.e. GoogleService-Info.plist
(apple) & google-services.json
(android).
The correct implementation is to put the service file in separate folders. e.g.
ios/dev/GoogleService-Info.plist
ios/staging/GoogleService-Info.plist
Even if you implement your own way of bundling the service file, you will still need to name the file by their convention, otherwise, the native Firebase SDKs will not recognise it. So there is no point in naming it anything else.
@russellwheatley that's a great point - didn't know that. You'll still be allowing for different directories though right?
yes, you can take a look at this table in description for possible commands.
Use the flag --ios-out=ios/whatever/directory/GoogleService-Info.plist
to write it to directory of your choice for iOS.
Is there an existing feature request for this?
Command
No response
Description
We should have the option to specify custom file names for the
google_services_info.json
andGoogleServicesInfo.plist
files, so that the name doesn't collide with the existing ones.Reasoning
This is vital in an effort to have the flutterfire_cli supporting multiple app flavors. The flutterfire_cli currently asks the user if they want to replace the files, which is not what users would want when trying to add flavors.
Additional context and comments
The end goal would be for something like this
Which would generate a new firebase project and create the
google-services-info-dev.json
andGoogleServicesInfoDev.plist
files.