LanDiscoverer
Discovers services of serviceType advertised on the local network.
discover returns a cold Flow that emits a LanHost each time a new host is found (de-duplicated by host+port+payload for the lifetime of the collection). Cancelling the collector tears down the platform listener. The JVM actual additionally sends a one-shot UDP "probe" so already-advertising hosts answer immediately rather than only on their next beacon tick.
Permissions the consuming app must declare
This is a library module with no manifest of its own, so nothing here is declared for you.
Android 17 / API 37 and above —
android.permission.ACCESS_LOCAL_NETWORKis a runtime permission gating mDNS/DNS-SD, local-network scanning and casting. Discovery returns no results without it. Declare it in the manifest and request it at runtime before collecting, exactly as you would for location or camera. This bites when you movetargetSdkto 37, not when you compile against it.iOS 14 and above —
NSLocalNetworkUsageDescriptionplus anNSBonjourServicesentry naming the service type, both inInfo.plist. Bonjour silently finds nothing if either is missing.All Android versions —
INTERNET.
The Android actual carries @SuppressLint("MissingPermission") because a library module cannot declare what its consumer must request. That suppression is not a claim that no permission is needed; on API 37 it would be an actively wrong one.
Discovers services of serviceType advertised on the local network.
discover returns a cold Flow that emits a LanHost each time a new host is found (de-duplicated by host+port+payload for the lifetime of the collection). Cancelling the collector tears down the platform listener. The JVM actual additionally sends a one-shot UDP "probe" so already-advertising hosts answer immediately rather than only on their next beacon tick.
Permissions the consuming app must declare
This is a library module with no manifest of its own, so nothing here is declared for you.
Android 17 / API 37 and above —
android.permission.ACCESS_LOCAL_NETWORKis a runtime permission gating mDNS/DNS-SD, local-network scanning and casting. Discovery returns no results without it. Declare it in the manifest and request it at runtime before collecting, exactly as you would for location or camera. This bites when you movetargetSdkto 37, not when you compile against it.iOS 14 and above —
NSLocalNetworkUsageDescriptionplus anNSBonjourServicesentry naming the service type, both inInfo.plist. Bonjour silently finds nothing if either is missing.All Android versions —
INTERNET.
The Android actual carries @SuppressLint("MissingPermission") because a library module cannot declare what its consumer must request. That suppression is not a claim that no permission is needed; on API 37 it would be an actively wrong one.
Discovers services of serviceType advertised on the local network.
discover returns a cold Flow that emits a LanHost each time a new host is found (de-duplicated by host+port+payload for the lifetime of the collection). Cancelling the collector tears down the platform listener. The JVM actual additionally sends a one-shot UDP "probe" so already-advertising hosts answer immediately rather than only on their next beacon tick.
Permissions the consuming app must declare
This is a library module with no manifest of its own, so nothing here is declared for you.
Android 17 / API 37 and above —
android.permission.ACCESS_LOCAL_NETWORKis a runtime permission gating mDNS/DNS-SD, local-network scanning and casting. Discovery returns no results without it. Declare it in the manifest and request it at runtime before collecting, exactly as you would for location or camera. This bites when you movetargetSdkto 37, not when you compile against it.iOS 14 and above —
NSLocalNetworkUsageDescriptionplus anNSBonjourServicesentry naming the service type, both inInfo.plist. Bonjour silently finds nothing if either is missing.All Android versions —
INTERNET.
The Android actual carries @SuppressLint("MissingPermission") because a library module cannot declare what its consumer must request. That suppression is not a claim that no permission is needed; on API 37 it would be an actively wrong one.
Discovers services of serviceType advertised on the local network.
discover returns a cold Flow that emits a LanHost each time a new host is found (de-duplicated by host+port+payload for the lifetime of the collection). Cancelling the collector tears down the platform listener. The JVM actual additionally sends a one-shot UDP "probe" so already-advertising hosts answer immediately rather than only on their next beacon tick.
Permissions the consuming app must declare
This is a library module with no manifest of its own, so nothing here is declared for you.
Android 17 / API 37 and above —
android.permission.ACCESS_LOCAL_NETWORKis a runtime permission gating mDNS/DNS-SD, local-network scanning and casting. Discovery returns no results without it. Declare it in the manifest and request it at runtime before collecting, exactly as you would for location or camera. This bites when you movetargetSdkto 37, not when you compile against it.iOS 14 and above —
NSLocalNetworkUsageDescriptionplus anNSBonjourServicesentry naming the service type, both inInfo.plist. Bonjour silently finds nothing if either is missing.All Android versions —
INTERNET.
The Android actual carries @SuppressLint("MissingPermission") because a library module cannot declare what its consumer must request. That suppression is not a claim that no permission is needed; on API 37 it would be an actively wrong one.
Discovers services of serviceType advertised on the local network.
discover returns a cold Flow that emits a LanHost each time a new host is found (de-duplicated by host+port+payload for the lifetime of the collection). Cancelling the collector tears down the platform listener. The JVM actual additionally sends a one-shot UDP "probe" so already-advertising hosts answer immediately rather than only on their next beacon tick.
Permissions the consuming app must declare
This is a library module with no manifest of its own, so nothing here is declared for you.
Android 17 / API 37 and above —
android.permission.ACCESS_LOCAL_NETWORKis a runtime permission gating mDNS/DNS-SD, local-network scanning and casting. Discovery returns no results without it. Declare it in the manifest and request it at runtime before collecting, exactly as you would for location or camera. This bites when you movetargetSdkto 37, not when you compile against it.iOS 14 and above —
NSLocalNetworkUsageDescriptionplus anNSBonjourServicesentry naming the service type, both inInfo.plist. Bonjour silently finds nothing if either is missing.All Android versions —
INTERNET.
The Android actual carries @SuppressLint("MissingPermission") because a library module cannot declare what its consumer must request. That suppression is not a claim that no permission is needed; on API 37 it would be an actively wrong one.
Constructors
Functions
ponytail: @SuppressLint("MissingPermission") is kept, but it is NOT a statement that no permission is needed — NSD discovery has always wanted INTERNET plus (historically) CHANGE_WIFI_MULTICAST_STATE, and Android 17 (API 37) introduces ACCESS_LOCAL_NETWORK as a runtime permission gating mDNS/DNS-SD outright. The suppression exists because this is a library module with no manifest of its own; the consuming app declares and requests. Left in place so the module still lints clean, documented here so the next reader does not mistake it for "no permission required" — which is exactly what it would have meant on API 37.