Mac Address

Hello, I am trying to create a indoor GPS where it shows the client where to go to. In this case my school (I am currently on a High School program of computer science) This is my final proyect and I was thinking on making an app. What I wanted to do was to grab the Mac Address of every access point in my school (there is one on each room) and add them with a if statement that could say if (mac address from room 212 == current mac address) then you are near room 212 and that way the app will now where are you located on the school. Now the problem is that I tried to get the Mac Address and I get 02:00:00:00:00.... and this as you know is not a correct mac address. So I searched a little bit and I got this info from a developer telling me that it is not possible now to get the Mac Address from an Access point thanks to an announcement done by Apple regarding unique identifiers not being able to get by Developers. I wanted to know if there is any possibility on getting access to the Mac Address through another way.



This was the developer's response:


Hello Gabriel,

Apple has made it very clear that they will no longer be allowing developers to access unique identifiers of devices for App Store applications. They've stopped allowing developers to read the MAC address from devices and are unlikely to allow it in the future. If you'd like, you can file a bug report or request an enhancement to the SDK to allow this, but I don't think this will change anytime soon.

If there is a way to gather MAC address information without using private API's, I will update the class as soon as possible.

I hope that answers your question.

Thanks,
Shmoopi



----


I will appreciate a lot if you could help me with that. I also tried to get the IP address but all access points of my school have the same one and the problem my computer science teacher said was that it is possible that they could change them and then the app will stop working meanwhile the Mac Address as it is a unique identifier it is impossible to change and it will be the best option.



Note: There is no language preference, I was working with Objective-C to get the Mac Address and doing the app in Swift (combining the two) because I saw a code online on how to get the mac address, but if you have it on Swift it will be better.

Thank you in advance!

Gabriel Posada

Accepted Reply

When talking about Wi-Fi access points (APs), the MAC address of the AP is pretty much synonymous with the AP’s BSSID. It’s easy to get the BSSID of the AP that your device is associated with: call

CNCopyCurrentNetworkInfo
from
<SystemConfiguration/CaptiveNetwork.h>
.

WARNING Given the privacy implications of this it’s likely that this information will not be available in the long term. In fact, we tried to make it unavailable in iOS 9 but withdrew that change after it caused a host of compatibility problems (you can read the backstory in this seven page thread). For a high school final project it’s fine to use this; you could even mention the state of this API in your write up as a perfect example of the tension between technical solutions and social acceptance. However, I strongly recommend against folks using it in a shipping product.

Share and Enjoy

Quinn "The Eskimo!"
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Replies

Sorry, MAC address is masked in iOS. What you seek is no longer possible.

Also, the MAC address isn't impossible to change on the router hardware. (My home wireless router even has two convenient buttons, one to clone my laptop's MAC address and the other to enter any arbitrar MAC address I'd like.) The MAC addresses on the wireless routers are just as easy for the access point administrators to change as the IP addresses are, simply because the devices can be told to use an arbitrary address instead of the factory assigned one.


However, it sounds like you're getting the MAC addresses of the various devices and interfaces conflated. Almost all of the time, the discussions concerning getting the MAC address of a mobile device revolves around getting the address for that device, an address which is completely different from the MAC address of the wireless access point.


What you're trying to do is generally done by:

  1. Determine the IP address of the default gateway.
  2. Perform an ARP query for the MAC address of the gateway.


What you don't want to do is just use code to get the device's MAC address, because that's just going to keep giving you the MAC address of the iPod touch or iPhone that you're using. And when you try to do that, you're going to get the masked/falsified MAC address.


But, really, at this point what you need to ask is "What do I do when I discover that the technical details of my senior project are wrong? With whom do I discuss changes to the project?"

yes, this was the same thing I got as a response from the developer I asked but is it possible on getting it by some other way? I have searched apps on the app store that displays the Mac Address from a router or access point but why I can't do the same??... how do they get it.

I know that a MAC address can't be changed that is why my teacher told me that it was the best way of doing my app because as it is not possible to change I will have a working App until they change the access points (the hardware).


Regarding the coding, I am using a code already created by a developer to get the MAC address from the Access Point not the Device. It is still showing a Masked or False Mac Address.




HHELP!

It's masked because the code you're using and apparently do not understand

IS grabbing the local (device) not the remote(access point/router). To get

anything from the access point or router you must query that hardware

directly which is not supported under the cfnetwork frameworks. In other

words, you need to write your own networking routines and actually poll

the access point yourself.

BY the way, as NotMyName stated, the MAC address of routers and access points

CAN be changed. It's the MAC address of your iPod iPhone iPad or Mac that can't

be changed.

If you're using the right code to get the router's mac address and it's being masked, then that means that the iOS privacy measures are blocking it. If that's the case, then it's wonderful news and it saves everyone else work. Your projected as you have specified it is impossible to accomplish and no one can help you until you change the terms of your project or you choose to do a different project.


Dealing with unexpected technical challenges, or unexpected technical failures, is an excellent life lesson and an excellent opportunity for personal growth. Please don't waste this opportunity that you have been presented with.

When talking about Wi-Fi access points (APs), the MAC address of the AP is pretty much synonymous with the AP’s BSSID. It’s easy to get the BSSID of the AP that your device is associated with: call

CNCopyCurrentNetworkInfo
from
<SystemConfiguration/CaptiveNetwork.h>
.

WARNING Given the privacy implications of this it’s likely that this information will not be available in the long term. In fact, we tried to make it unavailable in iOS 9 but withdrew that change after it caused a host of compatibility problems (you can read the backstory in this seven page thread). For a high school final project it’s fine to use this; you could even mention the state of this API in your write up as a perfect example of the tension between technical solutions and social acceptance. However, I strongly recommend against folks using it in a shipping product.

Share and Enjoy

Quinn "The Eskimo!"
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Thank you Very Much I will contact you if I have any other problems. Thanks for your help, much appreciated!.