mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-05-14 02:14:54 +08:00
android: fixed once and on error handling
This commit is contained in:
@@ -4,7 +4,6 @@ import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
|
||||
import android.util.Log;
|
||||
import android.content.Context;
|
||||
import android.support.annotation.Nullable;
|
||||
|
||||
import com.facebook.react.bridge.Callback;
|
||||
@@ -31,6 +30,7 @@ interface KeySetterFn {
|
||||
public class RNFirebaseModule extends ReactContextBaseJavaModule implements LifecycleEventListener {
|
||||
private static final String TAG = "RNFirebase";
|
||||
private FirebaseApp app;
|
||||
private ReactApplicationContext reactContext;
|
||||
|
||||
public RNFirebaseModule(ReactApplicationContext reactContext) {
|
||||
super(reactContext);
|
||||
@@ -146,7 +146,7 @@ public class RNFirebaseModule extends ReactContextBaseJavaModule implements Life
|
||||
try {
|
||||
Log.i(TAG, "Configuring app");
|
||||
if (app == null) {
|
||||
app = FirebaseApp.initializeApp(getReactApplicationContext().getBaseContext(), builder.build());
|
||||
app = FirebaseApp.initializeApp(reactContext, builder.build());
|
||||
}
|
||||
Log.i(TAG, "Configured");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user