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