I am using the firebase realtime database in my app. The functionality I am trying to achieve is simply to be able to change the value of a key in a time interval after its been changed.
More specifically, There is an authorized key and a boolean value in my database.
{
"user" : {
"UserID" : {
"Authorized" : "True"
}
This value gets changed to false after client side event happens
{
"user" : {
"UserID" : {
"Authorized" : "False"
}
Is it possible to be able to automatically change this value back to true within a time interval? For example, 'change back to true in 1 minute' This function would need to take place server side, for a timer will not be able to run once the user terminates the app. I believe firebase cloud functions may be of use, but I haven't been able to see exactly how it would be done.
I also looked into cron jobs, however, a cron job runs indefinitely for a certain time interval. In my case, after the value has been changed to false I just need it to change back to true once.
This functionality is similar to snapchats delete a snap in 24 hrs concept.
Im using Swift in Xcode. Any help or suggestion is very much appreciated!