subscribe method

void subscribe([
  1. bool force = false
])

Subscribes to the channel.

Implementation

void subscribe([bool force = false]) async {
  if (!client.connected ||
      (subscribed && !force) ||
      client.socketId == null) {
    return;
  }

  _subscribed = false;

  options.log("SUBSCRIBE", name);

  client.sendEvent("pusher:subscribe", {"channel": name});

  if (isPublic) _subscribed = true;
}