问题描述
我有一个 android 应用程序,我想在数据更改时只向一位用户发送通知.我怎样才能做到这一点.谁能提供一个代码片段,我可以放入 OnDataChange() 方法以向特定用户发送通知.由于在 Firebase 中,身份验证后将为每个用户创建一个唯一的用户 ID,有没有办法将通知发送给特定用户或仅发送给使用该用户 ID 的一组用户.
I have an android app and I want to send notifications to only one user when data is change. How can I do that. Could anyone give a code snippet that I can put in OnDataChange() Method to send notification to a specific user. Since In Firebase there will be an unique user id created to every user after authentication, Is there any way to send the notification to a particular user or only to a group of Users using that userid.
推荐答案
您可以为该用户创建主题并订阅该主题,然后 Firebase 允许我们使用主题消息向特定主题发送消息.请看这个链接
You can make topic for this user and subscribe to that topic then Firebase allow us to send message to specific topic using topic message. Kindly Look at this link
https://firebase.google.com/docs/cloud-消息传递/android/topic-messaging
还有这个
如何使用 FCM 向特定用户发送通知?
希望它会有所帮助.
这篇关于仅向 Firebase 中的一位用户发送通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!


大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)