3

I have a list of ip addresses in my local wifi network (192.168.1.100-105). How can I get device names? For example "My desktop PC". Application like Fing can do it.

I've found some examples:

iPhone Tip: No NSHost

and

How to get Domain Name of ipAddress and ipAddress from Domain Name in objective-c

but looks like they works only with addressees from the internet, not from the local network.

Thank you!

Community
  • 1
  • 1
user1575129
  • 33
  • 1
  • 3

2 Answers2

2

There are three main protocols that you can use to get information about devices on your local network: Bonjour, NetBIOS and UPnP. Of these only the first one has build in support in iOS. So you will have to search for libraries or write your own implementation of the other two.

idz
  • 12,825
  • 1
  • 29
  • 40
0

If by device name, you meant UDID (Unique Device Identifier) of the iOS device, its against a proposed US Internet privacy law to access it. If your app tries to get the UDID, it might get rejected from appstore. If you want to track the devices on which your app is running, you can use a few virtual UDID generators like here:SecureUDID

If you just wanted some unique identifier to identify some device on a network, you might try reading the mac address of the network interface on iDevice. But doing that might/might-not run foul of Apple's guidelines.

Either way, Apple seriously frowns on apps that try to identify user devices (unless they are virtual UDIDs like in the link). So be very sure of what your aim is.

One disclaimer though..if your app is not targeted for sale in USA, accessing UDID is in grey (read unclear) area of Apple's guidelines.

aloha
  • 1,561
  • 13
  • 26
  • Thank you for your answer, but I haven't even mentioned about UDID, I'm looking for name in the network, like "My iPhone" – user1575129 Aug 04 '12 at 06:27