【问题标题】:Flutter notification when firestore collection changes (Background) [closed]Firestore 集合更改时的颤振通知(背景)[关闭]
【发布时间】:2018-11-06 21:24:27
【问题描述】:

当应用未打开时订阅的集合(firestore)发生变化时如何通知用户?

我在想,一旦集合(或集合中的文档)发生更改,也许应该使用 FCM 推送,但首先会调查替代路线。

提前致谢。

【问题讨论】:

  • 我已经这样做了,但是如果你强制关闭应用程序,它不会显示你的通知>>>medium.com/@rajeshjr/…

标签: firebase google-cloud-firestore flutter


【解决方案1】:

您可以使用在后端运行的云函数。当 Firestore 集合中的文档更新并发送 Firebase Cloud Messaging 通知时会触发它。

您可以在此处找到显示如何发送 FCM 通知的 Cloud Function 示例:https://github.com/firebase/functions-samples/tree/master/fcm-notifications 和此处的 Firebase FCM 文档:https://firebase.google.com/docs/cloud-messaging/concept-options

您可以在此处找到 Cloud Functions 的 Firestore 触发器的文档:https://firebase.google.com/docs/functions/firestore-events

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-01-21
    • 2018-06-05
    • 2020-08-02
    • 2019-01-09
    • 2020-10-01
    • 2020-01-26
    • 2021-04-28
    • 1970-01-01
    相关资源
    最近更新 更多