Skip to content

Conversation

russellwheatley
Copy link
Member

@russellwheatley russellwheatley commented Oct 25, 2023

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 refactor
  • ci -- Build configuration change
  • 📝 docs -- Documentation
  • 🗑️ chore -- Chore

@russellwheatley russellwheatley temporarily deployed to CI Environment October 25, 2023 17:42 — with GitHub Actions Inactive
@russellwheatley russellwheatley temporarily deployed to CI Environment October 25, 2023 17:42 — with GitHub Actions Inactive
@russellwheatley russellwheatley temporarily deployed to CI Environment October 26, 2023 15:29 — with GitHub Actions Inactive
@russellwheatley russellwheatley temporarily deployed to CI Environment October 31, 2023 15:58 — with GitHub Actions Inactive
@russellwheatley russellwheatley temporarily deployed to CI Environment October 31, 2023 15:58 — with GitHub Actions Inactive
@russellwheatley russellwheatley changed the title docs: using FlutterFire CLI to configure your project with Firebase docs: using FlutterFire CLI v0.3.0-dev.19 to configure your project with Firebase Dec 7, 2023
Copy link
Contributor

@nilsreichardt nilsreichardt left a 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.

Comment on lines +126 to +134
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
```
Copy link
Contributor

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:
Copy link
Contributor

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.

Copy link
Contributor

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

Copy link
Member Author

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 👍

github-merge-queue bot pushed a commit to SharezoneApp/sharezone-app that referenced this pull request Dec 15, 2023
## 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants