有没有办法有2个应用程序具有不同的包名称1 Firebase数据库? [英] Is there a way to have 1 Firebase database for 2 apps with different package names?

查看:127
本文介绍了有没有办法有2个应用程序具有不同的包名称1 Firebase数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有2个应用程序(不同的包名称),适合2个不同的用户组。一个将数据放入数据库,另一个检索它。因此,我只需要两个应用程序的firebase数据库。 Firebase只允许1个数据库的1个包名,据我所知。有没有办法解决这个问题,并为2个应用程序有1个Firebase数据库?

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?

推荐答案

href =https://console.firebase.google.com> Firebase控制台。您只能通过项目获取一个数据库,但是您只需在控制台中添加多个应用即可。他们不需要具有相同的程序包名称或签名密钥。

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.

如果您有某些原因无法将它们添加到同一个项目,必须在客户端代码中手动配置至少一个应用程序。因此,不要使用 google-services.json 文件进行配置,您可以手动调用 FirebaseApp.initializeApp()填写信息,以便两个应用程序都在同一个Firebase项目。

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.

这篇关于有没有办法有2个应用程序具有不同的包名称1 Firebase数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆