title: How to connect two different Firebase projects to a single common Firebase database?
body: <p>Scenario: </p>
  
  <p>We have two different projects in Firebase named: <code>Customer</code> and <code>Merchant</code>.</p>
  
  <p>These two projects have been created in the Firebase Console so both have different project IDs and they can not be merged together into a single project. Each of them using Remote config feature from Firebase so both already have <code>google-services.json</code> configuration file in respective projects.</p>
  
  <p>Now, we need to introduce realtime chat feature using Firebase and want one on 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 <code>google-services.json</code> configuration file, which will conflict with the existing configuration files in both the projects.</p>
  
  <p>Meaning, if we take customer app then it already has one Firebase configuration. So how can I add another chat Firebase configuration in it?</p>
  
  <p>This is what I've tried:       </p>
  
  <ol>
  <li><p>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.</p></li>
  <li><p>In this approach, I tried to open up another Firebase instance programatically using the answer <a href="https://stackoverflow.com/questions/39366056/is-it-possible-to-connect-to-a-firebase-database-to-a-different-firebase-project">here</a>. But when I try to push any message to chat Firebase database, the connection closes with message <code>wrong project id</code> because the Firebase instance is considering the id of the customer app.</p></li>
  </ol>
  
  <p>With above approaches, it failed. Anyone has any idea how to proceed with this or is it possible or not?</p>