Skip to content

Basic Publish

The following example publishes a message to the default channel:

// do not forget to call Backendless.initApp in the app initialization logic

Backendless.Messaging.publish( "hello world!", new AsyncCallback<MessageStatus>()
{
  @Override
  public void handleResponse( MessageStatus response )
  {
    Log.i( "MYAPP", "message has  been published" );
  }

  @Override
  public void handleFault( BackendlessFault fault )
  {
    Log.e( "MYAPP", "server reported an error " + fault );
  }
} );