Companion

object Companion

Properties

Link copied to clipboard
private var onEnterBackground: () -> Unit?
Link copied to clipboard
private var onEnterForeground: () -> Unit?
Link copied to clipboard
private var onNetworkAvailable: (network: Network) -> Unit?
Link copied to clipboard
private var onNetworkCapabilitiesChanged: (network: Network, networkCapabilities: NetworkCapabilities) -> Unit?
Link copied to clipboard
private var onNetworkLost: (network: Network) -> Unit?

Functions

Link copied to clipboard
fun observe(context: Context, capabilities: List<Int> = listOf(NetworkCapabilities.NET_CAPABILITY_INTERNET), transportTypes: List<Int> = listOf( NetworkCapabilities.TRANSPORT_WIFI, NetworkCapabilities.TRANSPORT_CELLULAR ))

If your app have multiple process , make sure to call this one only on the main one only (UI)

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