Package-level declarations

The monitor, its configuration (ConnectivityConfig), the status model and the policies.

The monitor, its configuration (ConnectivityConfig), the status model and the policies.

The monitor, its configuration (ConnectivityConfig), the status model and the policies.

The monitor, its configuration (ConnectivityConfig), the status model and the policies.

The monitor, its configuration (ConnectivityConfig), the status model and the policies.

Types

Link copied to clipboard

Immutable monitor configuration. Every default reproduces the reference behaviour.

Link copied to clipboard
annotation class ConnectivityDsl

DSL scope marker for the configuration builders.

Link copied to clipboard
fun interface ConnectivityLogger

Receives diagnostic messages from the monitor.

Link copied to clipboard

Tells whether the device can reach the internet.

Link copied to clipboard
sealed interface ConnectivityStatus

Connectivity state reported by a ConnectivityMonitor.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@RequiresOptIn(message = "This connectivity API is experimental and may change without notice.", level = RequiresOptIn.Level.WARNING)
annotation class ExperimentalConnectivityApi

Marks API that may change in a binary- or source-incompatible way in a minor release.

Link copied to clipboard

What to report when the platform monitor cannot run or a check throws.

Link copied to clipboard
Link copied to clipboard

The status reported before the platform delivers its first reading.

Link copied to clipboard
class IosConfig
Link copied to clipboard

When ConnectivityMonitor.reconnected fires. It never fires for the first reading of the process.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The network transport behind a ConnectivityStatus.Connected status.

Link copied to clipboard

What counts as "connected" on platforms with native signals (Android, iOS).

Properties

Link copied to clipboard

Functions

Link copied to clipboard

Creates the Android monitor, backed by ConnectivityManager.registerDefaultNetworkCallback. Create one per process: every monitor registers its own callback, and Android limits an app to about 100.

Builds the configuration with block and creates the Android monitor; see the overload above.

Creates the iOS monitor, backed by NWPathMonitor. Create one per process.

Builds the configuration with block and creates the iOS monitor; see the overload above.

Creates the desktop (JVM) monitor. Create one per process.

Builds the configuration with block and creates the desktop monitor; see the overload above.

Creates the web (JS / Wasm) monitor, backed by navigator.onLine and the online/offline events, plus the optional fetch probe (web { probe { ... } }). Create one per page.

Builds the configuration with block and creates the web monitor; see the overload above.

Link copied to clipboard

Calls onChange with every ConnectivityMonitor.isConnected value on the main thread (or Dispatchers.Default where no main dispatcher exists). For Swift and for code without coroutines.