One Logo Pool Ball
Network · IOS API REFERENCE

BonjourListenerProvider

struct · iOS 26.0+ · SDK 27.1

struct BonjourListenerProvider

Advertise a Bonjour service.

Members (2)

init · iOS 26.0+

init

TypeScript
static init(name: (string) | null, type: string, domain?: (string) | null, txtRecord?: (NWTXTRecord) | null): BonjourListenerProvider
Swift declaration
init(name: String? = nil, type: String, domain: String? = nil, txtRecord: NWTXTRecord? = nil)

Create a Bonjour service to advertise. > Note: You can use `.bonjour()` as a convenience initializer. Advertised services should be registered with IANA. - Parameter name: The name to advertise. Defaults to `nil`, which allows the system to provide the name. - Parameter type: The Bonjour service type to advertise. - Parameter domain: The domain to advertise. Defaults to `nil`, which allows Bonjour to register in all default registration domains. - Parameter txtRecord: An optional text record to advertise. If not provided, Bonjour will not register any text record associated with this service. Later, a text record can be advertised by setting `service` on `NetworkListener` with a TXT record.

get · iOS 26.0+

service

TypeScript
get service(): NWListener_Service
Swift declaration
var service: NWListener.Service { get }

The service advertised by the listener.

Skipped declarations

No declarations were skipped in this snapshot.

All Network types →