Skip to content

Publish in the Future

The example demonstrates scheduling a message to be delivered on January 1st, 2030 at 00:00 Central time. The message is published into the demo channel:

String channelName = "demo";
DeliveryOptions deliveryOptions = new DeliveryOptions();
DateTime publishDate = DateTime.fromMillisecondsSinceEpoch(1893477600000); 
deliveryOptions.publishAt = publishDate;

Backendless.messaging.publish("Happy New Year!", channelName: channelName,
deliveryOptions: deliveryOptions).then((status) {
    print("Message has been published");