Connectivity

actual fun Connectivity(options: ConnectivityOptions, scope: CoroutineScope): Connectivity

Creates a Connectivity instance for Android platforms.

This function is platform-specific and its implementation is provided by Android platform.

Return

A Connectivity instance.

Parameters

options

The ConnectivityOptions used to configure the connectivity monitoring.

scope

The CoroutineScope in which the connectivity monitoring will be launched.

actual fun Connectivity(options: <Error class: unknown class>, scope: <Error class: unknown class>): <Error class: unknown class>

Creates a Connectivity instance for iOS platforms.

This function is platform-specific and its implementation is provided by iOS platform.

Return

A Connectivity instance.

Parameters

options

The ConnectivityOptions used to configure the connectivity monitoring.

scope

The CoroutineScope in which the connectivity monitoring will be launched.

fun Connectivity(scope: CoroutineScope = CoroutineScope(Dispatchers.Default), options: ConnectivityOptions.Builder.() -> Unit): Connectivity

Creates a Connectivity instance for device platforms using a builder pattern for the ConnectivityOptions.

Return

A Connectivity instance.

Parameters

scope

The CoroutineScope in which the connectivity monitoring will be launched. Defaults to a new CoroutineScope with Dispatchers.Default.

options

A lambda function that configures the ConnectivityOptions.Builder.


expect fun Connectivity(options: ConnectivityOptions = ConnectivityOptions(), scope: CoroutineScope = CoroutineScope(Dispatchers.Default)): Connectivity

Creates a Connectivity instance for device platforms.

Return

A Connectivity instance.

Parameters

options

The ConnectivityOptions used to configure the connectivity monitoring. Defaults to a new ConnectivityOptions instance.

scope

The CoroutineScope in which the connectivity monitoring will be launched. Defaults to a new CoroutineScope with Dispatchers.Default.