react-native-firestack icon indicating copy to clipboard operation
react-native-firestack copied to clipboard

configureWithOptions fix for android

Open BodySplash opened this issue 7 years ago • 2 comments

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.

BodySplash avatar Apr 28 '17 08:04 BodySplash

You're probably best off tackling this on my v3 fork of firestack if possible due to the current state of affairs here

v3: https://github.com/Salakar/react-native-firestack

Salakar avatar May 03 '17 16:05 Salakar

hum why not. Since you dropped all options passing, it will require a little more work to include my PR.

BodySplash avatar May 16 '17 08:05 BodySplash