如何在firebase管理中初始化多个应用程序



我是firebase云消息的新手,我正在node js上练习,我发现我们可以在同一项目上初始化多个应用程序。我想知道我们可以在一个项目中初始化多少应用程序

如何在Firebase Admin SDK 中初始化多个应用程序

对于这种情况,文档中有一个特定的部分。它显示以下代码:

// 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);

我想知道在一个项目中可以初始化多少应用程序

我没有这个问题的答案(即我不知道任何这样的限制(,但你可以初始化两个以上的应用程序。

相关内容

最新更新