How to Have 1 Firebase Database for 2 Apps with Different Package Names

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

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.

Multiple projects for one app in Firebase: What to give as Android Package Name

The package name has to be the same as in AndroidManifest.xml ("It's important to enter the package name your app is using", Firebase Documentation), so if you haven't somehow configured it to be different in your development environment, then you have to use the same one as in production. Projects added in Firebase don't "point to" anything; rather, your app will point to a Firebase project based on the contents of google-services.json. You will need to configure the app build variants to use the right file, see Support multiple environments in your Android application.

The instructions for adding Firebase to an Android project don't mention anything about SHA1 fingerprint, so you might not need it. If it turns out that you do, it is possible to add it later in Firebase Android project settings. However, you will have to add a release certificate SHA1 fingerprint to the production Firebase project before your app is launched (see Firebase Launch Checklist).

How do I set up multiple Firebase projects with the same bundle ID on Android?

In this case, it turns out I just needed to clear out the app/build folder. Apparently the Firebase configs get "cached" in some way between builds, so clearing it forces it to use the new configuration.

I've just added it as a step in the build process. After this small change, everything is working as expected.

Two Android apps and one Firebase database

Well from what I know you can add as many apps as you want for you'r project,just press add app on the FirebaseConsole.
You can use different package name or signing key

Send FCM from one Firebase account to apps compiled w/ different package names

It is recommend to have apps for different customers on separate Firebase projects. While combining them into a single project may work in some cases, there is no guarantee this may continue to work as you scale.

For example, you can only have a limited number of OAuth client IDs in a project, and a limited number of apps. Once you hit those limits, you'll need to set up multiple projects anyway, so you might as well do that straight away and find another way to optimize rolling out apps for new customers.

Can you have more than one iOS application utilizing the same Firebase back end?

You can add 30 apps to a single project to share data, as described in the documentation.

Firebase restricts the total number of Firebase Apps within a Firebase project to 30.

See also:

  • Multiple apps in one project or one project per app in Firebase?
  • Pros and cons of using one project for multiple apps in Firebase Could Messaging
  • Adding multiple apps in a firebase project
  • Add multiple apps to single project in Firebase
  • Is there a way to have 1 Firebase database for 2 apps with different package names?
  • https://groups.google.com/g/firebase-talk/c/VAtoKx6qJjw


Related Topics



Leave a reply



Submit