android – Is there a way to have 1 Firebase database for 2 apps with different package names?-ThrowExceptions

Exception or error:

I have 2 applications(different package names) catering to 2 different user groups. One puts data into database and the other retrieves it. Therefore I want only 1 firebase database for both the apps. Firebase allows only 1 database for 1 package name as far as I know. Is there a way to solve this problem and have 1 Firebase database for 2 apps?

How to solve:

Yes this is possible using the Firebase console. You only get one database per project but you can have many apps per project just by adding them in the console. They don’t need to have the same package name or signing key.

If you have some reason why you can’t add them both to the same project, you will have to configure at least one of the apps manually in client side code. So rather than using the google-services.json file for configuration, you can call FirebaseApp.initializeApp() manually and fill in the information so both apps are talking to the same Firebase project.

Leave a Reply

Your email address will not be published. Required fields are marked *