在应用程序关闭时检查Firebase数据库中的更改 [英] Checking for changes in Firebase database while application is closed
问题描述
在应用程序关闭的情况下,如何设置检查Firebase数据库中某个值的更改的正确方法,然后将通知推送给用户?
我应该使用服务
,警报
和 pendingService
完成这个任务?
另外,如果您的后台任务在其他系统中发生更改时触发参数如连接或任何特定的时间间隔或时间。
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屋!