【问题标题】:Flutter live notificationsFlutter 实时通知
【发布时间】:2021-07-23 20:50:03
【问题描述】:

我正在使用 Firestore 作为我的 Flutter 应用程序的数据库。对我的应用执行的某些操作会导致 Firestore 数据发生更改/更新。

我正在使用 Flutter 原生通知,这些通知会在单击按钮后生成。但是,尽管稍后在 Firestore 中更新了数据,但传递给通知的数据保持不变。

我想实现一项类似于体育应用程序中的功能,其中实时比分会在通知中定期更新。

如何在我的应用中实现这一点?我必须使用 Firestore 云消息传递吗?引用资源会很有帮助。

【问题讨论】:

    标签: firebase flutter android-studio google-cloud-firestore flutter-notification


    【解决方案1】:

    您想要实现的目标听起来像是使用 Firebase 云消息传递的理想案例。我建议您查看 overviewusage 的 Cloud Messaging 的 FlutterFire 文档,这应该会给您一个很好的起点。

    或者,您也可以使用 Cloud Function 作为 FCM 的主机,并且仅将您的应用配置为接收消息,您可以观看此video,了解如何创建 Cloud Function 端。

    【讨论】:

      猜你喜欢
      • 2020-05-04
      • 1970-01-01
      • 1970-01-01
      • 2022-11-28
      • 1970-01-01
      • 2020-07-10
      • 2021-03-23
      • 2019-06-28
      • 1970-01-01
      相关资源
      最近更新 更多