Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
458 views
in Technique[技术] by (71.8m points)

firebase - Using a listener after an android application is closed

I've just been reading about adding a service to my application, and since 7/8 there are now service restrictions to improve phone performance.

I've seen that the recommended approach is to use a job scheduler, but will that not just periodically start a new listener if I did that?

Basically I update my database, and using a snapshot listener I want to update my user in real time. When the app is closed, I'd like to send a notification.

My issues (if I'm correct) are that constantly making a new Firestore request will eat through my request allowance.

Also, if its a job scheduler it won't quite be real time?

I've read that you can use a foreground service, but this doesn't really seem like that task that needs a permanent notification and would annoy the user.

Anyone got any tips on how I'd implement this?

Thanks

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...