NetServiceBrowser service always fails on iPhone if we create build from xcode 12

NetServiceBrowser service always fails on iPhone if we create build from xcode 12.
Code Block
// We are using following line in to start searching for sevices available on network
//
        self.serviceBrowser.searchForServices(ofType: "_http._tcp.", inDomain: "local.")   


It return following error dicitonary : ["NSNetServicesErrorCode": -72008, "NSNetServicesErrorDomain": 10]

I did not find -72008 in error codes for NSNetServicesErrorDomain.

It works as exepcted with previous vesions of Xcode. With Xcode 12 it works only on Simulator.




Have you set NSBonjourServices?

Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"
In our application serviceBrowser is of type NetServiceBrowser. Should I use NSBonjourServices?

Thanks you for help. Its working now after adding NSBonjourServices in plist.
I have the same issue.

I have added both : "Privacy - Local Network Usage Description" & "Bonjour Services" to Info.plist

I have tried both syntaxes for Bonjour Services value as it seems to work in both ways depending on people feedback:
_Test._tcp
Test.tcp
I have tried with tcp and udp, or tcp or udp values for Bonjour Services

I still have the following error :
[MCNearbyServiceAdvertiser] Server did not publish: errorDict [{
  NSNetServicesErrorCode = "-72008";
  NSNetServicesErrorDomain = 10;
}].
Error Domain=NSNetServicesErrorDomain Code=-72008 "(null)"

on ios 14.1 and Xcode 12.1

What is wrong here ?

Error -72008 is NSNetServicesMissingRequiredConfigurationError, meaning that you’ve failed to configure the above-mentioned Info.plist property. If you’re using Multipeer Connectivity, see Local Network Privacy FAQ-14.

Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Hi :)

I was fiddling with the list of Bonjour Services in Info.plist and couldn't get it to work... But then I used the Console app and was able to see the exact string... turned out that I needed a '.' in the end...

From Console I got: "App Info.plist(NSBonjourServices) does not allow '_myprotocol._http._tcp.' for (My App)"

Then I just pasted that protocol name into Info.plist and it started to work :D

(It might be 'my' protocol name was illformed from the beginning.)

Happy days :)