0

I made an App and I want delete a story automatically after 24 hours. I can make it, but user should open app to check.

Now how can i check from firebase server without open app? I think it something like run script in server without stop.

I use firebase realtime database

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Null
  • 107
  • 1
  • 7

1 Answers1

3

You can use Firebase's Cloud Functions

Schedule Functions on an interval to delete a story:

exports.scheduledFunction = functions.pubsub.schedule('every 5 
minutes').onRun((context) => {
  // your code to delete something
  console.log('This will be run every 5 minutes!');
  return null;
});

Reference to scheduling Cloud Functions:

Alex Mamo
  • 130,605
  • 17
  • 163
  • 193
Praveen G
  • 794
  • 1
  • 13
  • 24