publish abstract method
@brief Method is used to publish a custom message to a specified MQTT topic. The message will be sent asynchronously and the result will be notified through @see MqttSessionListener "MqttSessionListener" callbacks (onMessagePublished for success, onError for failure). @note The MQTT session must be connected before calling this method. Use @see MqttSession::connect "connect" method first. @param topic MQTT topic to publish the message to. Can be any valid MQTT topic string. @param message Message content to publish. Can be any string (JSON, plain text, etc.).
Dart code snippet: @snippet mqtt_session_example.dart dart_MqttSession_publish
Implementation
void publish(String topic, String message);