0

I’m building a JavaScript(react native) application with firebase, and the idea is I want to write a function in firebase that makes a couple of API requests to an external api and then stores the data in Firestore, how ever I want this to happen once every 24 hours, or whenever some certain attributes in a specific users data (Users collection) changes so essentially this data rendered to the user changes every 24 hours, any tips on how I can approach this problem ?

Harold Obasi
  • 13
  • 1
  • 4

1 Answers1

1
exports.scheduledFunction = functions.pubsub.schedule('every 24 hours').onRun((context) => {
  console.log('This will be run every 24 hours!');
  return null;
});
Ajit Agarwal
  • 123
  • 8