How to connect two different Firebase projects to a single common Firebase database?

1,932 views
Skip to first unread message

abhishek....@go-jek.com

unread,
Sep 8, 2016, 10:58:55 AM9/8/16
to Firebase Google Group

Scenario: We have two different projects in Firebase named: Test1 and Test2.

Now, we need these two projects to connect to a common database, but as per our research, we found that to connect to a common database, we need two apps in a single project. That works but our goal is different.

Also, we can not merge these two projects because of certain issues, so that option will not work.

It would be great if anyone can guide us through!


abhishek....@go-jek.com

unread,
Sep 9, 2016, 10:40:02 AM9/9/16
to Firebase Google Group

Scenario:

We have two different projects in Firebase named: Customer and Merchant. These two projects have been created in Firebase console so both have different project id and they can not be merged together into a single project. Each of them using Remote config feature from firebase so both already have google-services.json configuration file in respective projects.

Now, we need to introduce realtime chat feature using firebase and want one to one chat between customer and merchant. If we use firebase then it states that even though we create another project Chat then it has another google-services.json configuration file, which will conflict with the existing configuration files in both the projects. Means, if we take customer app then it already has one firebase configuration so how can i add another chat firebase configuration in it?

This is what i have tried -:

  1. Made another android project named Chat and added its respective firebase config to it and then added it as a module in Customer android project which already has it's own firebase config. So, when i compiled that it considered the main app's that is Customer app config file as firebase config. It is not considering chat module json config at all.

  2. In this approach, i tried to open up another firebase instance programatically using this Is it possible to connect to a Firebase Database to a different Firebase Project? but when i try to push any message to chat firebase database then connection closes with message wrong project id because firebase instance is considering id of customer app.

With above approaches, it failed. Anyone has any idea how to proceed with this or is it possible or not?

Reply all
Reply to author
Forward
0 new messages