I've seen lots of APIs for Job Scheduling, if I may mention:
AlarmManager
JobScheduler
JobSchedulerCompat
GCMNetworkManager
And what I'm trying to do is, a user sets a date along with a campaign, he saved it in Firebase, and when that date comes, that created object gets deleted. I've seen something similar with Parse, but as you might know, it's shutting down and I'm storing my data in Firebase anyways.
However, AlarmManager
surely doesn't do the task in the cloud (The service doesn't run on the device, but in the cloud.)
JobScheduler
is not available for pre-lollipop.
JobSchedulerCompat
is deprecated "There's no guarantee this won't explode your device or drain your battery" and I don't think it runs in the cloud anyways.
And I'm not sure about GCMNetworkManager
. Does it run in the cloud or is it on the device? Tough example: If every single user who uses my app has his device shut down, will the task still be completed?
Long question short: Does GCMNetworkManager
run in the cloud? If not, what alternatives do I have?
Edit: @qbix's answer gave me a hint, but I still cannot understand anything from that link. If anyone answers my question along with an example, he will be awarded the bounty. This includes @qbix.
No, GCMNetworkManager
does not run in the cloud. It runs on the device just like the other schedulers you listed.
If I understand your requirements correctly, you should look into the Firebase Server SDK. You would create a server task with limited privileges to access the appropriate sections of your database. It would perform the needed database maintenance for all users on a periodic basis.