Is it possible to have two projects with the same package name?

1

My idea is to be able to use the same Google.services.json file for two different projects, since I have a limit of 3 projects in firebase and I have already used the maximum. I want to be able to use the same json file for two apps that use the same database. In what way could I do it ?, if I put the same name of the package to the two apps will it work?.

I hope you can help me, regards.

    
asked by Matías Nicolás Núñez Rivas 03.12.2018 в 02:33
source

2 answers

0

The package name (application id) of an application must be unique and can not be repeated between applications that are uploaded to Google Play ,

You can use a repeated name in tests but you will not be able to upload this application to the Google Play store.

Remember that the google-services.json file has references to the package name (application id)

Regarding your questions:

  

My idea is to be able to use the same Google.services.json file to   two different projects.

You can use the same google-services.json but the app id should not be repeated in the Google Play Store.

  

since I have a limit of 3 projects in firebase and I have already used the   maximum.

You can use a single project Firebase for your projects for that precisely the package name is used to differentiate one application from another, It is not necessary to create a project Firebase per application.

  

I want to be able to use the same json file for two apps that use the   same database. In what way could I do it ?, if I put the same name   of the package to the two apps will it work?.

You can use the same google-services.json file but in reality you want to use the same package name, if you want this you would actually be indicating the same application and not a different application.

    
answered by 03.12.2018 в 18:22
-1

If you can, in fact, I use it on some projects.

For example, I have an app that is an administrative app that I create content for another app, and at the same time both are connected, so I can manage and see content with one that the other generates.

To link two projects to the same Firebase account, you can do the following within Android Studio

Both in the first and second projects, you can connect it following these steps

From Android Studio

1.- Go to tools - Firebase

2.- Select any of the services and click the connect button

3.- Select the project where you want to connect the app you are working on

This window can skip you once if you fail to press connect, or you get another window in which you select an existing project and you continue to

I did not find the image where this window was coming from, but if you do not see the image above, it will probably come out earlier

That's where you choose to choose an existing project and link that project with a ready-made Firebase project. As you can see, in the option of choose an existing project, it tells us next to the number of linked apps that this project has.

Once connected, everything should be fine

From Firebase

1.- Configure project

2.- Add SHA-1 of your new app (pressing add fingerprint)

In this way we link more than one app to the same database

Remember, the most important thing is that you add the SHA-1 of the new project to the Firebase configuration. If you do it from Android Studio it is only put, if you do it from the web you have to add the SHA-1 of the new project.

Update

As you can see in this photo, I have 2 different projects connected to the same Firebase database, with different package names

    
answered by 03.12.2018 в 02:45