configureWithOptions fix for android by BodySplash · Pull Request #336 · fullstackreact/react-native-firestack · GitHub
Skip to content

configureWithOptions fix for android#336

Open
BodySplash wants to merge 3 commits into
fullstackreact:masterfrom
BodySplash:master
Open

configureWithOptions fix for android#336
BodySplash wants to merge 3 commits into
fullstackreact:masterfrom
BodySplash:master

Conversation

@BodySplash

Copy link
Copy Markdown

When a google-services.json is provided, Firestack auto-configures itself (see this article), so there is no way to pass custom options afterwards.

Removing the google-services.json didn't solve the issue, since building a FirebaseOptions without an applicationId throws an exception.

This patch detects if the firebase default app is already configured, otherwise uses params to set it up, without trying to build an empty FirebaseOptions.
Il also refactored a little bit the way params keys are searched to be complient with the params in the ios version.
I think this patch might resolve most of the "FirebaseApp[DEFAULT] already configured" errors in android apps, like in #265

Maybe the README should be updated to state clearly that .plist/.json and options from js are mutually exclusives way to configure firestack.

@Salakar

Salakar commented May 3, 2017

Copy link
Copy Markdown
Collaborator

@BodySplash

Copy link
Copy Markdown
Author

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