35

I have working with FCM console to send push notification and it has an option to schedule the delivery date.

But in the references, this API is not documented as an option. I need to know if its possible to push a notification with predefined delivery date through a POST request.

AL.
  • 36,815
  • 10
  • 142
  • 281
Herbey
  • 361
  • 1
  • 3
  • 5

2 Answers2

25

If you're looking for a public API of FCM for a scheduled push or a payload parameter where you can set the push date, unfortunately, there's nothing like it as of the moment.

You must implement your own App Server and implement the scheduled push yourself (also mentioned it here).

Community
  • 1
  • 1
AL.
  • 36,815
  • 10
  • 142
  • 281
  • 7
    Any update on this since last year? Has anyone found a way to set the "Delivery date" for a notification when not creating the notification via the FCM Console? – Rbar Jul 26 '17 at 23:44
  • @Rbar There is no update at the moment. Will update my answer as soon as there is. – AL. Jul 27 '17 at 03:15
  • Hi @AL. did you find any solution to schedule push notification using API's. – YBDevi Sep 08 '17 at 05:23
  • @YBDevi Unfortunately, FCM still doesn't have that feature when using the API. – AL. Sep 08 '17 at 05:33
  • Thanks @AL.Hope FCM add this feature it will help a lot. – YBDevi Sep 08 '17 at 05:34
  • Hi @AL. any improvement on this so far? – Jek Nov 11 '17 at 04:50
  • 1
    @choopage None as of the moment. Unfortunately. – AL. Nov 11 '17 at 08:18
  • You can schedule using Firebase Console, so i believe soon we'll have it on API's – Guilherme Ferreira Aug 01 '18 at 05:00
  • Any updates? Looking to put a 24 hour delay on notifications for free users. – Luke Pighetti Sep 18 '18 at 22:02
  • 1
    Hi guys, feel free to file a feature request here.. It appears we still don't have any updates on it yet. firebase.google.com/support/contact/bugs-features – Jainam Jhaveri Dec 07 '18 at 08:17
  • 1
    For anyone looking, this feature is now implemented in the FCM Compose interface - you can choose `Recipient Timezone` in the `Schedule` section. – Adam Mar 25 '20 at 17:08
  • 7
    Hey @Adam, the scheduling *in the console* has been there for a while. The question was focusing on an option that can be used with *the FCM APIs*. Cheers! – AL. Mar 25 '20 at 19:23
1

As an alternative to ALs excellent answer: you could:

  • send a data message with FCM straight away,
  • in that message include a field with when the message is to be displayed,
  • them in your application code show the message when it is due.

This has the added advantage that the message can be delivered when the user has a connection, and then displayed when they don't have a network connection.

Of course this only works if you can determine the exact message before it is displayed. If the contents of the message can only be known right before it is displayed, you will need to implement your own mechanism to schedule deliver as AL said in his answer.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807