2

I am assuming that someone has reserved 4:30 now and wants to save it to the server and notify the server from the server at 4:30.

I do not want to use the alarm system built into the smartphone.

I also watched Firebase cloud function lectures on YouTube and implemented them. And I've also seen CronJobs, which gets into the URL by alarm on time and executes the function. I have to set the time for the user and give an alarm to each individual.

halfer
  • 19,824
  • 17
  • 99
  • 186
dontknowhy
  • 2,480
  • 2
  • 23
  • 67
  • There is currently no given mechanism in Cloud Functions to schedule a single job to run at a given time. You will have to arrange that yourself. – Doug Stevenson Oct 09 '17 at 17:11
  • Then what should I use one? do you have any idea with this to implement these things? for anything. – dontknowhy Oct 09 '17 at 17:50
  • I don't use Firebase, but I assume you can use a cron job. You've mentioned them, did you try them? I assume it's just a question of calling a public endpoint with the appropriate access token? – halfer Oct 11 '17 at 22:25
  • Im new with firebase, and in the near future I will need to implement something like, I've been thinking in a node.js server with something like [this](https://www.npmjs.com/package/node-schedule). So you can read the schedules from your firebase data and then FIRE the notification via node.js. – Karlo A. López Oct 11 '17 at 23:36

2 Answers2

3

You may want to look at schedule functions looks like you can do something like:

export scheduledFunction = functions.pubsub.schedule('every 5 minutes')
.onRun((context) => {
  console.log('This will be run every 5 minutes!');
});
Luigi Agosti
  • 925
  • 10
  • 19
1

There is no straight forward way of doing this, but you can go ahead and create a custom scheduler to work around it. A great article with step by step instructions was released by the angularfirebase people at:

https://angularfirebase.com/lessons/scheduled-tasks-and-cron-jobs-with-firebase/

enter image description here

Joel
  • 838
  • 5
  • 12
  • Hi, this is no longer accurate. As the other answer suggests, this is now available in firebase with pubsub functions – joejknowles Feb 20 '20 at 11:19