使用带有 node.js 的 mongoose 和 fcm 推送通知

push notifications using mongoose and fcm with node.js

我正在使用 node.js 开发一个社交网络应用程序,作为该类别的任何应用程序,它包含 posts,我想在有新消息时向用户的所有关注者发送通知post 已添加。

我有所有用户的 fcm 令牌,但我想找到实现该目标的最佳方法,同时不会导致任何服务器过载。

我使用 mongoose 作为 orm,MongoDB 作为数据库

我可以用 fcm 实现这个吗,还是应该转移到 twilio 或任何服务

是的,您可以使用 FCM(Firebase Cloud Messaging) 实现此目的。

您必须弄清楚实施细节,因为这是根据您的项目要求定制的。
但是关于是否可能和服务器过载的问题:我非常确定这是可能的,并且通过深思熟虑地创建 device-groups or topics that allow you to send messages to multiple devices(in-a-go), there shouldn't be an overload on your servers, the FCM server should handle most of the workload. More details here.