-
Notifications
You must be signed in to change notification settings - Fork 61
docs: using FlutterFire CLI v0.3.0-dev.19
to configure your project with Firebase
#224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
v0.3.0-dev.19
to configure your project with Firebase
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great progress!
One important thing is missing: For iOS and macOS builds it's required that the FlutterFire CLI is installed. So in case someone is building their iOS/macOS app with CI/CD, installing the FlutterFire CLI needs to be part of the CI/CD pipeline. Otherwise, the build will fail. Same for people who are working in a team: every developer in this team needs to install the FlutterFire CLI.
for iOS: | ||
```bash | ||
flutterfire configure --platforms=ios --ios-bundle-id=your.bundle.id --ios-build-config=Release --ios-out=ios/release/GoogleService-Info.plist | ||
``` | ||
|
||
for macOS: | ||
```bash | ||
flutterfire configure --platforms=macos --macos-bundle-id=your.bundle.id --macos-build-config=Release --macos-out=macos/release/GoogleService-Info.plist | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be helpful to mention that you need to re-run this command with every build configuration, so you need also to run it with Profile
and Debug
. This was something what me confused at the beginning because I assumed that FlutterFire detects the build configs and adds it for all build configs automatically.
|
||
### Flutterfire reconfigure | ||
|
||
There is another command that you might want to run each time you configure your project with another Firebase product. For example, if you configure Real time database for your Firebase project, you will be required to reinstall every service file for each platform. By running: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's also important that you need to run flutterfire reconfigure
it you add later firebase_performance
or firebase_crashlytics
to your project. This is something that is super easy to oversee because you don't get any errors/warning when you run:
# First FlutterFire configure
flutterfire configure
# And then add firebase_crashlytics
flutter pub add firebase_crashlytics
In this case, the 'FlutterFire: "flutterfire upload-crashlytics-symbols"' build phase in XCode is missing.
Something for the future: Maybe a better user experience would be to add another build phase that checks, if the project uses firebase_crashlytics
and if yes -> check if 'FlutterFire: "flutterfire upload-crashlytics-symbols"' is present in XCode, if no -> add it automatically or print a warning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also something that needs to be mentioned in the Firebase Analytics docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback, @nilsreichardt! I've made some updates based on your comments 👍
## Summary With this PR, we support `prod` and `dev` flavors for our macOS app. Make you sure, you have the [FlutterFire CLI](https://pub.dev/packages/flutterfire_cli) installed (version 0.3.0-dev.18 or higher), if you want to build for macOS. The FlutterFire CLI is used during the build process in the XCode build phases (configuring bundle service files and uploading Crashlytics symbols). ## Details Because the process of adding Firebase flavors to our macOS isn't documented well (there is a open PR with more documentation: invertase/flutterfire_cli#224), I'm describing here, what I did to support flavors. First, I needed to execute the following commands: ```sh flutterfire configure \ --project=sharezone-debug \ --platforms=macos \ --out=lib/firebase_options_dev.g.dart \ --macos-build-config=Debug-dev \ --macos-out=macos/config/dev \ --macos-bundle-id=de.codingbrain.sharezone.app.dev flutterfire configure \ --project=sharezone-debug \ --platforms=macos \ --out=lib/firebase_options_dev.g.dart \ --macos-build-config=Profile-dev \ --macos-out=macos/config/dev \ --macos-bundle-id=de.codingbrain.sharezone.app.dev flutterfire configure \ --project=sharezone-debug \ --platforms=macos \ --out=lib/firebase_options_dev.g.dart \ --macos-build-config=Release-dev \ --macos-out=macos/config/dev \ --macos-bundle-id=de.codingbrain.sharezone.app.dev flutterfire configure \ --project=sharezone-c2bd8 \ --platforms=macos \ --out=lib/firebase_options_prod.g.dart \ --macos-build-config=Debug-prod \ --macos-out=macos/config/prod \ --macos-bundle-id=de.codingbrain.sharezone.app flutterfire configure \ --project=sharezone-c2bd8 \ --platforms=macos \ --out=lib/firebase_options_prod.g.dart \ --macos-build-config=Profile-prod \ --macos-out=macos/config/prod \ --macos-bundle-id=de.codingbrain.sharezone.app flutterfire configure \ --project=sharezone-c2bd8 \ --platforms=macos \ --out=lib/firebase_options_prod.g.dart \ --macos-build-config=Release-prod \ --macos-out=macos/config/prod \ --macos-bundle-id=de.codingbrain.sharezone.app ``` The commands configure Firebase for each build config (`Debug-dev`, `Profile-dev`, `Release-dev`, `Debug-prod`, `Profile-prod`, `Release-prod`). Additionally, I needed to set `debug information format` to `DWARF with dSYM File`, see https://firebase.google.com/docs/crashlytics/get-started?platform=ios#set-up-dsym-uploading. ## Related Tickets Closes #352 Related to invertase/flutterfire_cli#14
Description
closes #188
closes #148
The following issues are due to windows setup issue which has now been documented:
closes #55
closes #49
closes #38
closes #180
closes #19
Type of Change
feat
-- New feature (non-breaking change which adds functionality)fix
-- Bug fix (non-breaking change which fixes an issue)!
-- Breaking change (fix or feature that would cause existing functionality to change)refactor
-- Code refactorci
-- Build configuration changedocs
-- Documentationchore
-- Chore