Search code examples
iosbonjournsnetservice

Get local network hostnames in iOS


I would like to get All device name in entire local network. I just been searching over 2 days and haven't find a solution yet.

I can able to get Bonjour services with using NSNetServiceBrowser. What i am trying to do is same as Fing app ( in app store) does.

As screenshot below, I would like to get "My iPhone" iPhone name with iOS.

Fing can fetch all device name entire local-network successfully

Regards

Onder


Solution

  • Seems like NEHotspotHelper is what you're looking for. Specifically a class func supportedNetworkInterfaces() -> [Any] method.

    In order to make it work, you'll need to accomplish some additional steps. Please, check this question to get more information.

    Also don't forget to add NetworkExtension.framework to your target.