I know that the Multipeer Connectivity framework uses bonjour to discover local devices. Another app in our app suite uses a bonjour implementation for zeroconf. Can I use the Multipeer framework in a new application to discover the same services as the other apps in the suite without needing to modify the implementation in the other applications?
Replies
You might be able to discover them but you wouldn’t be able to talk to them. The on-the-wire protocol used by Multipeer Connectivity is not documented for third-party development.
Taking a step back, why would you use Multipeer Connectivity for this rather than a dedicated Bonjour API [1]? What advantages are you hoping to achieve?
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
[1] Like the NWBrowser class.
-
Ah I see! Thank you very much for the clarification Quinn. I have read through the documentation and the various WWDC presentations about bonjour. Is the current recommended implementation using the NetService and NetServiceBrowser or the NWConnection/NWListener/NWBrowser?
Is the current recommended implementation using the
NetServiceandNetServiceBrowseror theNWConnection/NWListener/NWBrowser?
The latter.
Indeed, the older Foundation APIs were put on the path deprecation in the 2021 SDKs.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"