streamNotifyUserSubscribe method

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

Implementation

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

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