Backendless.Messaging.publish promise not called


App ID = 28A40095-0806-3BDD-FFC1-FED764753200

In my JS server code (timer) I am publishing a push notification. The message is delivered fine but the promise (.then) is never called. This is my (simplified) code:

let promises = []

Backendless.Messaging.publish(“groningen”, message, publishOptions).then(response => {
console.log("push notification has been published, message status = ", response.status);
return Promise.all(promises)

the log line in the .then function does not end up in the logging.


I took a look on your code of the Timer and figured out the problem is with Promise.all and promises array</img>

you have to change your code a little and it will work as you expected

Regards, Vlad

Good catch! Thanks for pointing that out. I solved it with adding another promises array and waiting for it after the first has finished.