Neha Agarwal
Neha Agarwal

Reputation: 253

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

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?

Upvotes: 22

Views: 11677

Answers (1)

Sam Stern
Sam Stern

Reputation: 25134

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.

Upvotes: 31

Related Questions