[英]how to initialize multiple app in firebase admin
I am new to firebase cloud messaging and i am practicing it on node js and i found that we can initialize more than one app on same project.我是 firebase 云消息传递的新手,我正在节点 js 上练习它,我发现我们可以在同一个项目上初始化多个应用程序。 I want to know up to how many app can we initialize in one project
我想知道在一个项目中最多可以初始化多少个应用程序
How to initialise multiple apps in Firebase Admin SDK
如何在 Firebase Admin SDK 中初始化多个应用程序
There is a specific section in the doc for this case.对于这种情况,文档中有一个特定的部分。 It shows the following code:
它显示以下代码:
// Initialize the default app
initializeApp(defaultAppConfig);
// Initialize another app with a different config
var otherApp = initializeApp(otherAppConfig, 'other');
console.log(getApp().name); // '[DEFAULT]'
console.log(otherApp.name); // 'other'
// Use the shorthand notation to retrieve the default app's services
const defaultAuth = getAuth();
const defaultDatabase = getDatabase();
// Use the otherApp variable to retrieve the other app's services
const otherAuth = getAuth(otherApp);
const otherDatabase = getDatabase(otherApp);
I want to know up to how many app can we initialize in one project
我想知道在一个项目中最多可以初始化多少个应用程序
I don't have the answer to this question (ie I don't know about any such limit) but you can initialise more than two apps.我没有这个问题的答案(即我不知道任何这样的限制),但你可以初始化两个以上的应用程序。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.