在应用程序关闭时检查Firebase数据库中的更改 [英] Checking for changes in Firebase database while application is closed

查看:138
本文介绍了在应用程序关闭时检查Firebase数据库中的更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在应用程序关闭的情况下,如何设置检查Firebase数据库中某个值的更改的正确方法,然后将通知推送给用户?

我应该使用服务警报 pendingService 完成这个任务?

解决方案

>

检查此关于如何使用android服务来运行后台任务。



另外,如果您的后台任务在其他系统中发生更改时触发参数如连接或任何特定的时间间隔或时间。

What is the 'right' way to set up checking for changes of a value in Firebase DB, while application is closed, and then push notifications to a user?

Should I use Service, Alarm and pendingService classes to get that done?

解决方案

You should use android Service to run your tasks on background even after your app has closed.

Check this link on how to use the android services to run background tasks.

Also Alarm and pending services work best if your background task gets triggered upon change in other system parameters such as connectivity or any specific time interval or time.

这篇关于在应用程序关闭时检查Firebase数据库中的更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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