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

Add support for multiple Firebase projects, and switching between apps for Firebase Authentication #711

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

emmernme
Copy link

This PR implements support for initializing multiple Firebase Apps with custom configurations. This can be used by individual plugins by overriding the currently used app. For now, this is only implemented and tested for Firebase Authentication, as this was the use case I personally needed, but it should be simple enough to implement for other plugins as well.

I have not had the change to thoroughly test the web implementation of this, so that may need some more work.

Re. issue #653.

Pull request checklist

  • [On iOS and Android] The changes have been tested successfully.
  • [Y] A changeset has been created (npm run changeset).
  • [Y] I have read and followed the pull request guidelines.

packages/app/src/definitions.ts Outdated Show resolved Hide resolved
packages/app/src/definitions.ts Outdated Show resolved Hide resolved
packages/app/src/web.ts Outdated Show resolved Hide resolved
packages/app/src/web.ts Outdated Show resolved Hide resolved
packages/authentication/src/definitions.ts Outdated Show resolved Hide resolved
packages/authentication/src/definitions.ts Outdated Show resolved Hide resolved
@emmernme
Copy link
Author

emmernme commented Sep 4, 2024

I've made the desired changes, and implemented FirebaseApp.getApps() so that it returns an array of app names – we could adapt this to return more info, such as the appId, but that doesn't seem necessary as the usage of initializeApp ensures the user can keep track of app names and the connected options in their implementation.

@robingenz
Copy link
Member

Thanks, i will get back to you soon. I have a lot to do at the moment.

@emmernme
Copy link
Author

Just letting you know, I've discovered several bugs in the Android implementation that will need fixing before this can be implemented. I'm currently pretty stuck, but will update once I've come up with a solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants