使用Firebase进行数据库更新的后台通知 [英] Background notification with firebase on database update

查看:124
本文介绍了使用Firebase进行数据库更新的后台通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望当我的数据库更新时,Firebase会向我的应用发送通知。例如,当我写在该数据库中的新条目,该应用应当接收通知,即使应用程序被关闭。

I want that firebase sends a notification to my app when my database is updated. For example when I write a new entry in this database, the app should receive a notification, even if the app is closed.

推荐答案

由于您使用的是Firebase,我建议您使用 Cloud Messaging 功能。您可以发送数据消息,应用程序知道数据库已更新。在此处查看更多相关信息: https://firebase.google.com/docs/ cloud-messaging / concept-options

Since you are using Firebase I would suggest you to use the feature Cloud Messaging. You can send a Data Message and the application knows that the database was updated. Check more info about it here: https://firebase.google.com/docs/cloud-messaging/concept-options

这篇关于使用Firebase进行数据库更新的后台通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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