streamNotifyUserSubscribe method

void streamNotifyUserSubscribe(
  1. WebSocketChannel webSocketChannel,
  2. User user
)

Implementation

void streamNotifyUserSubscribe(WebSocketChannel webSocketChannel, User user) {
  Map msg = {
    "msg": "sub",
    "id": user.id! + DateTime.now().millisecond.toString(),
    "name": "stream-notify-user",
    "params": [
      user.id! + "/notification",
      {"useCollection": false, "args": []}
    ]
  };

  logInfo('🚀🚀  streamNotifyUserSubscribe $msg');

  webSocketChannel.sink.add(jsonEncode(msg));
}