向特定用户发送通知 [英] Send notification to a specific user

查看:51
本文介绍了向特定用户发送通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在用户收到消息时发送通知.

I would like to send a notification when a user receives a message.

例如当用户A向用户B发送消息时,我希望该用户B收到通知,例如在Facebook Messenger中.

For example When user A send a message to user B, I would like that B receives a notification, like in Facebook Messenger.

为此,我在数据库中注册了FCM TOKEN,但我不知道如何使用我的代码向特定用户发送通知.

To do that, I register the FCM TOKEN in my database but I do not know how to send a notification to a specific user with my code.

我在firebase的文档中看到他们提出了 FCM服务器但我不知道如何在iO上使用它.

I saw in the documentation of firebase that they proposes a FCM SERVER but I do not know how to use it on iOs.

谢谢您的帮助!

推荐答案

有很多关于此的在线教程.找到了一个可能解决您的问题的方法: https://www.raywenderlich.com/140836/firebase-实时聊天教程2

There are many tutorials about that online. Found one that might solve your problem: https://www.raywenderlich.com/140836/firebase-tutorial-real-time-chat-2

通常,您只需要为1-1消息创建频道并将其推送到该频道即可.

In general, all you need is to create channels for your 1-1 messages and push to that channel.

希望有帮助.

这篇关于向特定用户发送通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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