iOS-14 netServiceBrowser.searchForServices Not working

Viewed 3260

Recently i updated my phone to iOS 14 and since then netServiceBrowser.searchForServices(ofType:"xyz._tcp", inDomain: "local.") not working at all. iPhone is not able to discover any services and not calling any NetServiceBrowserDelegate methods.

2 Answers

Your app requires access to the local network, and iOS14 has a new privacy option that requires authorization for this.

You have to add NSLocalNetworkUsageDescription to your Info.plist, see apple docs

If you use Bonjour, you need to déclare it in info.plist too...

<key>NSBonjourServices</key>
<array>
    <string>_http._tcp</string>
</array>
Related