简体   繁体   中英

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可以成功获取整个本地网络的所有设备名称

Regards

Onder

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM