I am trying to allow my users to set an expiration timer (up to 2 hours) for data stored in Firebase. The data needs to be deleted once the timer expires, but I've been having trouble finding a solution that will accomplish this even if the app is terminated. The timer is also displayed to the user and needs to be kept up to speed when the user re-opens the app. Also, other users shouldn't be able to see the data if it expired while the creator's app was terminated.
The only thing I could think of was using timestamp comparisons, which seems really inefficient. What's the best approach to this? Thank you in advance!