3

In my iPhone/iPad app there is need to display list of devices connected the my router. Please refer the image the as shown below.

enter image description here

But problem is I do not get consistent result for example sometimes bonjour will detect 3 devices where-in actually it would be connected to 5 devices to router.

Is there any better alternative to bonjour to achieve the same functionality. Please suggest/advice on this.

Also it detects only iPhone/iPad devices only connected to network not any android devices connected to the same router.

Thanks

sia
  • 1,872
  • 1
  • 23
  • 54

1 Answers1

1

Bonjour is a good and fast approach, but it will only detect the devices that support Bonjour.

You could try to ping every device on the local network. The challenge here would be to determine the start and end IP addresses. It's pretty easy and this answer explains it very well.

You'll need to get the subnet mask and this is how you can do it on iOS.

This method is not going to work all the time and it will take 3-4 seconds to complete. This is why Bonjour (or other ZeroConf implementations) is really cool and useful for fast local device discovery.

Community
  • 1
  • 1
Felix Lapalme
  • 1,058
  • 1
  • 11
  • 25