Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6212

Exception 'nil FIRApp instance passed to databaseForApp.' was thrown while invoking on on target RNFirebaseDatabase with params in react native

$
0
0

I am new to setting up firebase in react native and I want to initialize a second configuration in firebase but I am having an error.

This is my code:

const secondaryAppConfig = {      apiKey: ...,      authDomain: ...,      databaseURL: ...,      projected: ...,      storageBucket: ...,      messagingSenderId: ...,      appId: ...,      measurements: ...    };    const secondaryApp = firebase.initializeApp(secondaryAppConfig, 'secondary');    secondaryApp.database()      .ref(`test`)      .on('value', (snap) => {        const test = snap.val();        console.log(test.sample);      });

This is the error that shows:

Exception 'nil FIRApp instance passed to databaseForApp.' was thrown while invoking on on target RNFirebaseDatabase with params ( SECOND,"...", { appName = SECONDARY; eventType = value; hasCancellationCallback = 0; key = "..."; modifiers = ( ); path = test; registration = { eventRegistrationKey = "..."; key = "..."; registrationCancellationKey = "..."; }; })


Viewing all articles
Browse latest Browse all 6212

Trending Articles