简体   繁体   English

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

[英]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.

相关问题 ReactNative 在应用程序启动时初始化 Firebase? - ReactNative initialize Firebase at app start? 我如何使用 firebase 初始化我的应用程序 - how do i initialize my app using firebase Firebase SDK for Python:如何使用apiKey初始化App? - Firebase SDK for Python: How to initialize App using apiKey? 是否可以使用模拟服务帐户初始化 Firebase Admin SDK? - Is it possible to initialize the Firebase Admin SDK with an impersonated service account? 在Golang中只用环境变量初始化Firebase Admin SDK - Initialize Firebase Admin SDK with only environment variables in Golang 使用 Secret Manager 中存储的秘密初始化 Firebase Admin SDK - Initialize Firebase Admin SDK using secret stored in Secret Manager 使用 Firebase 管理员 SDK,无法部署 Firebase 跨多个文件拆分的云功能:“默认 Firebase 应用程序已存在” - Using Firebase Admin SDK, Unable to Deploy Firebase Cloud Functions Split Across Multiple Files: "The default Firebase app already exists" 在 Atlas 触发器(节点 JS)中正确初始化 Firebase admin SDK - Initialize correctly Firebase admin SDK in Atlas trigger (Node JS) 如何通过 Firebase Admin 针对代理连接到 Firebase? - How to connect to Firebase by Firebase Admin against a proxy? 如何在 firebase 版本 9 (firebase v9) 中初始化 firebase? - How to initialize firebase in firebase version 9 (firebase v9)?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM