startHeartbeat method

void startHeartbeat()

Start the presence heartbeat.

Call this after connecting. The heartbeat keeps the user marked as online on the backend. Call stopHeartbeat when the app goes to background.

Implementation

void startHeartbeat() {
  _ensureInitialized();
  ChatLogger.debug(
    'Starting presence heartbeat: ${_registry.config.heartbeatInterval}',
  );
  _registry.adapter.startHeartbeat(
    _userId ?? '',
    _registry.config.heartbeatInterval,
  );
}