-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Description
I'm trying to initialize Firebase from JS as following:
- I configured this module on a clean project
- In index.android.js added the line import RNFirebase from 'react-native-firebase'
- In index.android.js i added the following before render():
componentWillMount() {
firebase.initizlizeApp({
apiKey: 'apikey',
authDomain: 'authdomain',
databaseURL: 'dburl',
storageBucket: 'bucket',
messagingSenderId: 'senderid'
});
} - i also tried to do it different as in the example:
componentWillMount() {
const firebase = new RNFirebase();
const configurationOptions = {
debug: true,
googleAppID: 'appid',
APIKey: 'appkey',
databaseURL: 'dburl',
storageBucket: 'bucket',
androidClientID: 'clientid',
GCMSenderID: 'senderid'
};
const firebase = new RNFirebase(configurationOptions);
}
But in both attemps i get the following error on the emulator:
Default FirebaseApp is not initialized in this process com.xxx. Make sure to call FirebaseApp.initializeApp(Context) first. getInstance null:-1 getInstance null:-1 <init> RNFirebaseAuth.java:50 createNativeModules RNFirebasePackage.java:38 processPackage NativeModuleRegistryBuilder.java:88 processPackage ReactInstanceManager.java:950 createReactContext ReactInstanceManager.java:891 access$600 ReactInstanceManager.java:104 doInBackground ReactInstanceManager.java:218 doInBackground ReactInstanceManager.java:197 call AsyncTask.java:304 run FutureTask.java:237 runWorker ThreadPoolExecutor.java:1133 run ThreadPoolExecutor.java:607 run Thread.java:761
Am i doing anything wrong?