isAutomaticSyncOnReconnectEnabled

Parameters

isAutomaticSyncOnReconnectEnabled

Specifies if local data is updated with subscribing to web-socket events after reconnection. When turning this off, it is up for SDK user to observe web-socket connection state for reconnection and syncing data by calling, for example ChatClient.queryChannels, or the StatePlugin methods such as ChatClient.queryChannelsAsState / ChatClient.watchChannelAsState. Note that these calls fetch the latest state and also subscribe to web-socket events if the query's watch is set to true.

Web-socket connection status can be monitored by observing the ClientState.connectionState flow, exposed from the ChatClient.clientState:

client.clientState.connectionState.collectLatest { state ->
when (state) {
is ConnectionState.Connected -> {
// Data can be updated and watching can be resumed
}
else -> {}
}
}