Skip to content

Basic Publish

The following example publishes a message to the default channel:

Non-blocking API

var channel = "default",
    message = "Hello, world!";

Backendless.Messaging.publish( channel, message )
 .then( function( response ) {
 .catch( function( error ) {

Blocking publish

var channel = "default",
    message = "Hello, world!";

var response = Backendless.Messaging.publishSync( channel, message );
// message has been published, message status is available via response.status
// if publish failed - the error is described in response.errorMessage