sendAction method
Implementation
@override
void sendAction(String contactPubsubToken, ChatwootActionType actionType) {
final ChatwootAction action;
final identifier = jsonEncode(
{"channel": "RoomChannel", "pubsub_token": contactPubsubToken});
switch (actionType) {
case ChatwootActionType.subscribe:
action = ChatwootAction(identifier: identifier, command: "subscribe");
break;
default:
action = ChatwootAction(
identifier: identifier,
data: ChatwootActionData(action: actionType),
command: "message");
break;
}
connection?.sink.add(jsonEncode(action.toJson()));
}