startWebSocketConnection method
void
startWebSocketConnection(})
override
Implementation
@override
void startWebSocketConnection(String contactPubsubToken,
{WebSocketChannel Function(Uri)? onStartConnection}) {
final socketUrl = Uri.parse(_baseUrl.replaceFirst("http", "ws") + "/cable");
this.connection = onStartConnection == null
? WebSocketChannel.connect(socketUrl)
: onStartConnection(socketUrl);
connection!.sink.add(jsonEncode({
"command": "subscribe",
"identifier": jsonEncode(
{"channel": "RoomChannel", "pubsub_token": contactPubsubToken})
}));
}