publish method

dynamic publish(
  1. ChabokMessage message
)

Implementation

publish(ChabokMessage message) {
  var msgMap = <String, dynamic> {
    'userId': message.userId,
    'content': message.content
  };

  if (message.channel != null) {
    msgMap['channel'] = message.channel;
  }

  if (message.data != null) {
    msgMap['data'] = message.data;
  }

  if (message.notification != null) {
    msgMap['notification'] = message.notification;
  }

  _channel.invokeMethod("publish", msgMap);
}