code: public MessageStatus publish( String channelName, Object message, PublishOptions publishOptions, DeliveryOptions deliveryOptions )
    {
      channelName = getCheckedChannelName( channelName );
  
      if( message == null )
        throw new IllegalArgumentException( ExceptionMessage.NULL_MESSAGE );
  
      if( deliveryOptions.getPushBroadcast() == 0 && deliveryOptions.getPushSinglecast().isEmpty() )
      {
        deliveryOptions.setPushBroadcast( PushBroadcastMask.ALL );
      }
  
      return (MessageStatus) Invoker.invokeSync( MESSAGING_MANAGER_SERVER_ALIAS, "publish", new Object[] { channelName, message, publishOptions, deliveryOptions } );
    }
docs: Publishes message to specified channel.The message may be configured as a push notification. It may have headers
  and/or subtopic defined in the publishOptions argument.
  
  @param channelName     name of a channel to publish the message to. If the channel does not exist, Backendless
  automatically creates it.
  @param message         object to publish. The object can be of any data type - a primitive value, String, Date, a
  user-defined complex type, a collection or an array of these types.
  @param publishOptions  an instance of ${@link com.backendless.messaging.PublishOptions}. When provided may contain
  publisher ID (an arbitrary, application-specific string value identifying the publisher),
  subtopic value and/or a collection of headers.
  @param deliveryOptions an instance of ${@link com.backendless.messaging.DeliveryOptions}. When provided may specify
  options for message delivery such as: deliver as a push notification, deliver to specific
  devices (or a group of devices grouped by the operating system), delayed delivery or repeated
  delivery.
  @return a data structure which contains ID of the published message and the status of the publish operation.