0

When my iphone is connected to a WiFi network, I pings each IP on the network and builds the ARP Cache and then reads the MAC address from the ARP Cache table like this. It works well before ios 10, but when i run this code on ios 10 machine, i can't get the right MAC address, always return 02:00:00:00:00:00! But it can work well on iphone 7 simulator!!! I don't know how it happen! Is there something change about ARP API?

Community
  • 1
  • 1
XuQibin
  • 1
  • 1

1 Answers1

0

If you want to identify devices,Apple recommend to use identifierForVendor. May be you managed to get the MAC address post iOS 7 till iOS 9 but it's not guaranteed for future release.So better use identifierForVendor as recommended by Apple.Here is the release note of iOS 7 from Apple.

In iOS 7 and later, if you ask for the MAC address of an iOS device, the system returns the value 02:00:00:00:00:00. If you need to identify the device, use the identifierForVendor property of UIDevice instead. (Apps that need an identifier for their own advertising purposes should consider using the advertisingIdentifier property of ASIdentifierManager instead.)

Abhijith
  • 3,094
  • 1
  • 33
  • 36
  • Thanks,but identifierForVendor can only identify ios devices,i need to identify other devices! – XuQibin Jan 18 '17 at 08:37
  • Other devices in different platforms ? There you can continue using MAC address right. ? – Abhijith Jan 18 '17 at 12:06
  • I have found a solution [here](http://stackoverflow.com/questions/41283688/mac-addresses-in-ios-10-2),thanks anyway! – XuQibin Jan 19 '17 at 03:06