Firebase FCM,同一firebase项目中的多个应用程序 [英] Firebase FCM, multiple apps in the same firebase project

查看:168
本文介绍了Firebase FCM,同一firebase项目中的多个应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Firebase项目,在其中注册了多个应用程序. 现在,我想添加推送通知,并且希望能够区分哪个应用应通过推送通知唤醒.

I have a Firebase project in which I registered multiple apps. now I want to add push notification, and I want to be able to distinguish which app should wake up by the push notification.

在google-services.json文件中,我看到所有应用程序的api key部分中current key的值都相同,这是因为我在同一个Firebase项目中注册了这些应用程序.

in the google-services.json file, I see that all the apps have the same value for the current key in api key section, I understand it is because I registered the apps in the same Firebase project.

我还阅读了有关SERVER_KEY的信息,并看到有一个添加SERVER KEY的选项.可以添加多个服务器密钥并在服务器中使用它们,以便为正确的应用发送推送通知?

I also read about the SERVER_KEY, and saw that there is an option to add SERVER KEY. can I add multiple server keys and use them in my server, in order to send the push notification for the correct app?

或者是否有其他解决方案可以让我将应用程序保留在同一Firebase项目中,但可以区分哪个应用程序应通过推送通知唤醒?

or is there any other solution that allows me to keep the apps registered in the same Firebase project but distinguish which app should wake up by the push notification?

推荐答案

是的,您可以在同一项目中使用多个应用程序,可以使用firebase数据结构来区分应用程序:

Yes, You can use multiple apps within the same project, you can use the firebase data structure to distinguish between apps:

(用作使用频道) https://www.firebase.com/docs/web/guide/structuring-data.html

基于我的经验,不建议这样做.在iOS平台上,当同一设备上的多个应用共享相同的Firebase密钥时,这对我造成了一些奇怪的行为,因此我的建议是为每个应用打开一个新项目(当然,这也是纪录片的最佳实践)Android很好.

With that said, from my experience, this is not recommended. At iOS platform, when multiple apps on the same device shared the same firebase keys, it caused some strange behavior for me, so my advice would be to open a new project per app (Pretty sure that is the documentary best practice too) Android worked fine.

这篇关于Firebase FCM,同一firebase项目中的多个应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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