Basically, I am working on a system in which some users (dispatchers) can create calls, and then other users (volunteers) can respond to those calls.
Every call can have a status of open (default), covered (done by volunteer), closed (also done by volunteer).
Now what I need to do is whenever a call is created (it’s status is open), I want to schedule a function to send a notification every 2 minutes, until it’s status is changed to covered.
I tried to use setInterval() in firebase cloud function, but I read somewhere that it’s not possible to keep a cloud function alive for more than 9 minutes, and also I was facing some issue to cancel the timer once the call is covered.
Now I found cloud task to be something useful for me, but I can’t understand how would I start it, once the call is created, and then cancel it once the call is covered.
I have worked in firebase databases a lot of times, but cloud functions are something new to me, so I am quite a beginner to this 🙁