networkConnectivityStatusFlow
Observes the current network connectivity status.
Emits NetworkConnectivityStatus.Connected when the device has network access, NetworkConnectivityStatus.Offline when disconnected, or NetworkConnectivityStatus.Unknown when the status has not yet been determined.
Samples
scope.launch {
coreClient.networkConnectivityStatusFlow
.map { it == NetworkConnectivityStatus.Connected }
.collect { isOnline -> }
}Content copied to clipboard