watchChannelAsState
Performs ChatClient.queryChannel with watch = true under the hood and returns ChannelState associated with the query. The ChannelState cannot be created before connecting the user therefore, the method returns a StateFlow that emits a null when the user has not been connected yet and the new value every time the user changes.
Return
A StateFlow object that emits a null when the user has not been connected yet and the new ChannelState when the user changes.
Parameters
The full channel id, i.e. "messaging:123"
The number of messages that will be initially loaded.
The CoroutineScope used for executing the request.
Same as watchChannelAsState but loads messages around the given aroundMessageId in the initial request. Use this when opening a channel with focus on a specific message (e.g. deep-link) to avoid a race between the initial watch and a separate loadAround call.
Parameters
When non-null, the initial watch uses AROUND_ID pagination to load messages around this ID. Only use for channel-level focus (not when opening a thread).