NSNetService is deprecated, how to advertise network service that is written using non-Apple API?

I’m, using NSNetService in macOS & iOS to advertise a network service that is written in a cross-platform way using C++. Using the new Network framework, advertising via NWListener.Service seems only possible if the network interface is also written using NWListener. How can I advertise my network service via Bonjour without using the now deprecated NSNetService?

Thanks for any advise.

Answered by DTS Engineer in 687023022

[I have] a network service that is written in a cross-platform way using C++. … How can I advertise my network service via Bonjour without using the now deprecated NSNetService?

I’d use DNS-SD for this. If you need with that low-level API, check out the DNSSDObjects sample code.

Share and Enjoy

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

I would be very interested if anything besides the Bonjour C-API (e.g. DNSServiceRegister) is still supported on macOS & iOS.

Accepted Answer

[I have] a network service that is written in a cross-platform way using C++. … How can I advertise my network service via Bonjour without using the now deprecated NSNetService?

I’d use DNS-SD for this. If you need with that low-level API, check out the DNSSDObjects sample code.

Share and Enjoy

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

NSNetService is deprecated, how to advertise network service that is written using non-Apple API?
 
 
Q