Hi Quinn,
I've been experimenting with NetServiceBrowser to try to get a list of all local Bonjour broadcasts (for a developer app communicating with local devices). I have the com.apple.developer.networking.multicast entitlement and I have confirmed that Xcode is adding the entitlement to the app bundle.
private let serviceBrowser = NetServiceBrowser()
serviceBrowser.searchForServices(ofType: "_services._dns-sd._udp", inDomain: "local.")
serviceBrowser.schedule(in: RunLoop.main, forMode: .common)
Running in MacCatalyst under macOS 15.5, the NetServiceDelegate only gets an error, no services are found.
didNotSearch: ["NSNetServicesErrorDomain": 10, "NSNetServicesErrorCode": -72008]
On iOS 18, the NetServiceDelegate didFind function gets called for each local service, however calls to resolve for each service, result in didNotResolve. Calling the exact same code with a known service, such as "_airplay._tcp" works perfectly, resulting in the delegate receiving didFind for the service and subsequent netServiceDidResolveAddress and didUpdateTXTRecord call backs.
I have tried NWBrowser instead, but then found one of your posts stating that this API does not support searching for all available broadcasts. I also tried to adapt your BonjourResolver code but with that I only got a -65540: BadParam error when passing the _services._dns-sd._udp name.
I'm at a loss, and wonder if you know of any way I can get this to work under macOS 15 and iOS 18 ?
Many thanks