Skip to content
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

feat(*): support initializing default FirebaseApp instances from Dart #6549

Merged
merged 52 commits into from Nov 6, 2021

Conversation

russellwheatley
Copy link
Member

@russellwheatley russellwheatley commented Jul 6, 2021

Description

How it works

  • Maintain existing behaviour; Attempt to initialize default app on native, if no google-services.json or GoogleService-Info.plist (or if firebase.initializeApp() is not called from index.html for web ) is available, then dart will not have a default app.
  • Additional behaviour; once no default app is available, check if FirebaseOptions have been passed into initializeApp() (without the name parameter). Use these values to initialise default app.
  • Maintain existing behaviour; If name & FirebaseOptions are passed in, use these values to create additional app.

Untouched legacy plugins that internally initialise default app:

  • firebase_dynamic_links
  • firebase_in_app_messaging
  • firebase_ml_vision (also deprecated)

Untouched deprecated plugins:

  • firebase_admob

Untouched packages as they don't initializeApp() in example:

  • firebase_performance
  • firebase_ml_custom

Problem packages

  1. firebase_crashlytics. iOS requires this run script for your app to function. Your app will fail to build when using the run script (will also fail without) which fails with this error now we've removed GoogleServices.plist:

Screenshot 2021-07-08 at 12 51 53

It appears this upload-symbols script is looking for GoogleServices.plist property GOOGLE_APP_ID (We pass this in dart code now via this property FirebaseOptions.appId). This will probably require an intervention from Firebase Crashlytics team.

Additional config

  1. firebase_auth. Using verifyPhoneNumber() API does require an update to the user's ios/Runner/Info.plist, specifically adding the reverse client id as described in the documentation here. Also need to pass in iosClientId in the FirebaseOptions (see this commit).

Related Issues

none.

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]).
This will ensure a smooth and quick review process. Updating the pubspec.yaml and changelogs is not required.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • My PR includes unit or integration tests for all changed/updated/fixed behaviors (See Contributor Guide).
  • All existing and new tests are passing.
  • I updated/added relevant documentation (doc comments with ///).
  • The analyzer (melos run analyze) does not report any problems on my PR.
  • I read and followed the Flutter Style Guide.
  • I signed the CLA.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • Yes, this is a breaking change.
  • No, this is not a breaking change.

@google-cla google-cla bot added the cla: yes label Jul 6, 2021
appId: '1:448618578101:ios:2bc5c1fe2ec336f8ac3efc',
messagingSenderId: '448618578101',
projectId: 'react-native-firebase-testing',
));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: trailing coma (here and other example apps)

@Salakar Salakar marked this pull request as ready for review November 5, 2021 11:02
@google-cla
Copy link

google-cla bot commented Nov 5, 2021

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added cla: no and removed cla: yes labels Nov 5, 2021
@google-cla
Copy link

google-cla bot commented Nov 5, 2021

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@Ehesp
Copy link
Member

Ehesp commented Nov 5, 2021

@googlebot I consent.

@google-cla google-cla bot added cla: yes and removed cla: no labels Nov 5, 2021
@google-cla
Copy link

google-cla bot commented Nov 5, 2021

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added cla: no and removed cla: yes labels Nov 5, 2021
@Salakar
Copy link
Member

Salakar commented Nov 5, 2021

@googlebot I consent.

@Salakar Salakar changed the title feat(*): allow initializing default FirebaseApp instances from Dart feat(*): support initializing default FirebaseApp instances from Dart Nov 6, 2021
@Salakar Salakar merged commit 0a16d04 into master Nov 6, 2021
@Salakar Salakar deleted the @russell/initialize-app branch November 6, 2021 01:33
@firebase firebase locked and limited conversation to collaborators Dec 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants