0

I'm developing a simple application with Ionic 3, already linked to his Firebase project, which has to manage a Firestore database from another Firebase project.

The question is: there's a way to link multiple firebase project with Ionic 3?

I'm using angularfire2 and I have already read the official Firebase Documentation: https://firebase.google.com/docs/configure/#use_multiple_projects_in_your_application

But I can't understand how to do it with Ionic 3

Knospfer
  • 116
  • 7

1 Answers1

1

The docs are very clear on what to do. Example:

const firstAppConfig = {
    apiKey: "<API_KEY>",
    authDomain: "<PROJECT_ID>.firebaseapp.com",
    databaseURL: "https://<DATABASE_NAME>.firebaseio.com",
    storageBucket: "<BUCKET>.appspot.com",
};

const firstFirebase = firebase.initializeApp(firstAppConfig, "first")

const secondAppConfig = {
    apiKey: "<API_KEY>",
    authDomain: "<PROJECT_ID>.firebaseapp.com",
    databaseURL: "https://<DATABASE_NAME>.firebaseio.com",
    storageBucket: "<BUCKET>.appspot.com",
};

const secondFirebase = firebase.initializeApp(secondAppConfig, "second")

const thirdAppConfig = {
    apiKey: "<API_KEY>",
    authDomain: "<PROJECT_ID>.firebaseapp.com",
    databaseURL: "https://<DATABASE_NAME>.firebaseio.com",
    storageBucket: "<BUCKET>.appspot.com",
};

const thirdFirebase = firebase.initializeApp(thirdAppConfig, "third")
Cisco
  • 20,972
  • 5
  • 38
  • 60