realtimeConnectionState

abstract val realtimeConnectionState: Flow<ServerSentEvent.Connection>

Observes the state of the real-time connection to the messaging service.

Emits connection lifecycle states: ServerSentEvent.Connection.Connecting, ServerSentEvent.Connection.Open, ServerSentEvent.Connection.Closed, and ServerSentEvent.Connection.Ping.

The real-time connection is established when start is called and closed when stop is called.

val connectionState by coreClient.realtimeConnectionState
.collectAsStateWithLifecycle(initialValue = ServerSentEvent.Connection.Closed)