configureWithOptions fix for android #336
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.