firebase - Flutter 和 Firebase:动态推送通知,例如 Whatsapp
问题描述
我见过的关于通知主题的大多数教程要么通过 Firebase 控制台广播通知,要么创建应用程序内通知,如果应用程序在后台或完全关闭,这些通知将不起作用。
即使应用程序关闭,有没有办法使用 Flutter 和 Firebase 动态弹出通知?诸如 Whatsapp 或 Instagram 通知之类的东西。
我所说的 Whatsapp 等通知的参考图像:https ://www.techidence.com/wp-content/uploads/2020/10/WhatsApp-Nootifications.jpg
解决方案
您将无法直接从 Flutter 生成动态通知。由于要执行此操作,该应用程序必须处于活动状态。通常你会从某种后端发送这类通知。Google Cloud Messaging 为此公开了一个 API,它允许您向 Endpoint 发送 POST 请求,而 Google 会处理实际通知的发送。
在“1.发送通知”这一点下查看这篇文章
https://medium.com/@selvaganesh93/firebase-cloud-messaging-important-rest-apis-be79260022b5
推荐阅读
- windows - 如何在windows中新建命令“使用chrome打开网址搜索单词方便在线学习英语”
- python - 来自 id() 函数调用的指针?
- python - 带有张量流 2.0 的 tflearn
- loops - 关于在应用程序脚本中循环的非常简单的问题
- javascript - 防止传单弹出窗口中的图像缓存?
- python - 使用 Python 3 翻转数字
- android - 在android文本视图中显示带有内联样式属性的html字符串
- django - 石墨烯突变返回 400 - 不会正确传递 id 字段
- macos - 如何在正在运行的进程的内存中搜索字符串和其他数据?
- css - 悬停图像淡入淡出