Aakash Prajapati
Aakash Prajapati

Reputation: 41

iOS-14 netServiceBrowser.searchForServices Not working

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.

Upvotes: 3

Views: 5535

Answers (3)

sun sreng
sun sreng

Reputation: 715

here is my solutions that work for me well

<key>NSLocalNetworkUsageDescription</key>
<string>Allow Flutter tools on your computer to connect and debug app</string>
<key>NSBonjourServices</key>
<array>
    <string>_dartobservatory._tcp</string>
</array>

Upvotes: 1

Emmanuel Crombez
Emmanuel Crombez

Reputation: 305

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

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

Upvotes: 6

Itay Brenner
Itay Brenner

Reputation: 810

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

Upvotes: 6

Related Questions