没有云功能或 Firebase 控制台的 Firebase 通知 [英] Firebase notifications without cloud functions or the firebase console

查看:25
本文介绍了没有云功能或 Firebase 控制台的 Firebase 通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在不使用云功能或 Firebase 控制台的情况下向设备发送通知.例如.就像在聊天应用程序中发送消息时一样,另一个用户应该收到收到消息的通知,就像在 WhatsApp 中一样.谢谢

Is there any way to send device to device notification without using cloud functions or firebase console. eg. like when sending a message in chat app, another user should receive a notification of message received like in WhatsApp. Thanks

推荐答案

这取决于你所说的没有云功能"是什么意思.FCM 中没有直接的设备到设备功能,因此要将 FCM 消息发送到您确实需要某种类型的后端的设备.

It depends on what you mean by "without cloud functions". There is no direct device to device feature in FCM so to send an FCM message to a device you do need a back end of some type.

您可以使用 Cloud FirestoreRealtime Database 的实时功能在写入新消息时收到通知并在本地生成通知,但这仅适用对于前景情况.

You could use the realtime features of Cloud Firestore or Realtime Database to be notified when a new message has been written and generate the notification locally, however this would only work for foregrounded case.

这篇关于没有云功能或 Firebase 控制台的 Firebase 通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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