12

In the Firebase console we can set a specific time and date when will our notification will be push. But is there a way that we can set it daily? For example it will send every Monday, Wednesday and Friday or everyday?

Antoine Guénard
  • 502
  • 5
  • 12
natsumiyu
  • 3,217
  • 7
  • 30
  • 54

3 Answers3

15

Recurring messages are available in FCM now. May be helpful to someone.

Daily

custom

Shyju M
  • 9,387
  • 4
  • 43
  • 48
  • is there a way to do this programmatically ? – Chris Dec 29 '22 at 14:51
  • 1
    its not working. Its working nonsense. Once per user for this message. So every user just take the message once. What the daily do i dont know. There is a problem with this. – vitralyoz Apr 08 '23 at 18:43
  • @vitralyoz I have the same feeling, do you have any solution to send daily per user? – shtse8 May 14 '23 at 13:49
11

Push campaigns with Firebase Notifications can be sent now or later (scheduled).

You could probably switch to Firebase Cloud Messaging, use their HTTP API and then build a cron script to trigger your notifications automatically on these days.

Or switch to a more mature product like Parse Server, Batch.com or anything else as they usually provide that daily/weekly/monthly recurring push notifications feature.

Ramesh R
  • 7,009
  • 4
  • 25
  • 38
Antoine Guénard
  • 502
  • 5
  • 12
  • 1
    It's been 2 years, has anything changed? – Babken Vardanyan Apr 30 '18 at 06:17
  • 1
    @BabkenVardanyan nothing changed, Firebase Console is still very basic when it comes to push notifications scheduling. You can send "Now" or "Later" but you can *not* setup a recurring (daily) scenario. You can still play with Firebase Functions to setup a cron with this https://github.com/firebase/functions-cron and then trigger the notification with Firebase Cloud Messaging API. Contrary to Firebase, Batch.com provides a way to schedule daily recurring notifications, see https://batch.com/doc/dashboard/push/timing-delivery.html#_recurring. – Antoine Guénard Apr 30 '18 at 16:01
  • Thanks, I ended up writing a cron job. – Babken Vardanyan Apr 30 '18 at 16:03
  • UPDATE: You can set up the daily recurring FCM notifications now. – Adi Jul 02 '19 at 14:56
1

If you want to schedule functions to run at specified times, use functions.pubsub.schedule().onRun() This convenience method creates a Google Cloud Pub/Sub topic and uses Google Cloud Scheduler to trigger events on that topic, ensuring that your function runs on the desired schedule.

https://firebase.google.com/docs/functions/schedule-functions

a0x2
  • 1,995
  • 1
  • 18
  • 26