Reputation: 31
I'd like to detect in a Mac application if there currently are iPhone / iPod Touch devices on the same network (Wifi or LAN) at a given moment. My first attempt was some kind of auto discovery using bonjour, but as far as I understand, bonjour would have to be running as server on the iOS device. This is not suitable for me as i need some sort of generic network detection of iOS devices without them having running a certain app. sharing
Upvotes: 3
Views: 1057
Reputation: 5266
iain's answer describes what you need to do, but I think your idea has a flaw. There is no way for a Mac app to detect whether other devices on the same network are iOS devices or other computers without them running some code to answer the Mac.
In other words, the iOS device being part of a network doesn't give any traffic based fingerprint that shows what type of device they are.
Upvotes: 1
Reputation: 5683
There's a few ways you could try, although I'm sure they could throw up false positives.
If on Wifi, you could compare the BSSIDs of the access points which would let you know if they were both connected to the same access point.
Or you could do some manipulation with the IP address and the netmask which would tell you the subnet address, and how many IP addresses there are on that subnet, and if the subnets match and both IP addresses are within the subnet range then its likely that they're both on the same network.
Sorry I don't have any more concrete solutions, but maybe this will help you get somewhere.
Upvotes: 1