如何将Firebase消息发送到项目中的特定应用程序? [英] How to send Firebase message to specific application in project?

查看:158
本文介绍了如何将Firebase消息发送到项目中的特定应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个基于firebase的疑问。它允许为单个项目添加多个应用程序。我已经添加了App1,App2和App3。我如何才能单独向App1发送通知?服务器密钥与这3个应用相同。

解决方案

在Firebase控制台的通知面板中,您可以发送通知消息到特定的应用程序。但是,在Firebase Cloud Messaging API中不支持这种定位。

通过为每个应用定义特定的属性,您可以轻松地模拟这些行为: / topics / apps-app1 / topics / apps-app2 ,然后让每个应用都订阅自己的主题,并且您可以将每个应用的用户定位到一个FCM服务器密钥。


I have a doubt based on firebase. It allows to add multiple application for a single project. I have added App1, App2 and App3. How can I send a notification to App1 alone? Server key is the same for those 3 apps.

解决方案

In the Notifications panel in the Firebase Console, you can send a notification message to a specific app. But there is no support for such targeting in the Firebase Cloud Messaging API.

You can easily emulate the behavior though, by defining a specific property for each of your apps: /topics/apps-app1, /topics/apps-app2, etc. Then have each app subscribe to its own topic and you can target the users of each app with a single FCM server key.

这篇关于如何将Firebase消息发送到项目中的特定应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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