I'm creating an app where users are able to make posts which are contained in a tableview, but I'm wanting the posts to be deleted after 10 minutes. All users can see the 10 minute countdown.
I found this source : Delete NSTimer/UITableViewCell in real time?
They're seemingly setting up a date for the post to expire, setting up some timers to count down each second, and if that timeleft is 0, the post is deleted and the reference on firebase gets removed.
Does this not completely crash and burn if a user kills the application? So for example a user makes a post, it posts it to firebase, sends it out, the user kills the application, those timers stop, and the post is stuck forever. Surely each user needs a timer running for each post sent to them, but then who is in charge of deleting that reference on firebase?
My question is where/how is the best place to keep track of these timers? I don't know if there's some utilization of firebase that could be used here to make this more clean. I know how to use timers and how to delete the posts with the timers, but I'm just not sure how to structure this all out.
Aucun commentaire:
Enregistrer un commentaire