start

abstract fun start(scope: CoroutineScope)

Starts listening to remote events via a real-time connection.

While the client is started, real-time events are delivered through the events flow and push notifications are suppressed. Call stop to disconnect and resume push notification delivery.

The real-time connection lifecycle is tied to the provided scope. The host app is responsible for maintaining this scope — when the scope is cancelled, the connection is automatically closed.

Monitor the connection state by collecting CoreEvent.Connection events from the events flow or by observing realtimeConnectionState.

Parameters

scope

The CoroutineScope that controls the lifetime of the real-time connection.

Samples

LifecycleResumeEffect(Unit) {
    coreClient.start(scope)
    onPauseOrDispose { coreClient.stop() }
}