Hi there,
I struggle to get the mDNS name using _services._dns-sd._udp on iOS 26.1.
I tried two methods:
NetServiceBrowser always gives me
["NSNetServicesErrorCode": -72008 (missingRequiredConfigurationError), "NSNetServicesErrorDomain": 10]
DNSServiceBrowser fails with
NoAuth
I also tried NWBrowser, but learned that it does not work with _services._dns-sd._udp.
My Info.plist:
<key>NSBonjourServices</key>
<array>
<string>_services._dns-sd._udp</string>
</array>
<key>NSLocalNetworkUsageDescription</key>
<string>mDNS_Browser needs to have network access to search for Multicast services</string>
I tested it with a physical device, none of the above methods work. The strange thing is that NSBonjourServices works in the simulator the first time I use it but then fails, DNSServiceBrowser does not work. But with macOS 17 DNSServiceBrowser works but NSBonjourServices does not.
This is so random, I am out of ideas.
Here is an example project that can be used to test both methods: GitHub
@DTS Engineer :)
Topic:
App & System Services
SubTopic:
Networking
Tags: