My iPhone is connected to an access point through a WiFi connection. Does anybody now how I can retrieve this Access Point's MAC address with Objective-C?
Asked
Active
Viewed 1.3k times
2 Answers
7
It works for me
Add SystemConfiguration.framework
import < SystemConfiguration/CaptiveNetwork.h>
use the below method
+(NSString *)currentWifiBSSID { NSString *bssid = nil; NSArray *ifs = (__bridge_transfer id)CNCopySupportedInterfaces(); for (NSString *ifnam in ifs) { NSDictionary *info = (__bridge_transfer id)CNCopyCurrentNetworkInfo((__bridge CFStringRef)ifnam); NSLog(@"info:%@",info); if (info[@"BSSID"]) { bssid = info[@"BSSID"]; } } return bssid; }
Any usage of this code won't get your app rejected by Apple.
To know more about the Captive Network API click here

Durai Amuthan.H
- 31,670
- 10
- 160
- 241
-
Are you aware of a way of getting the access point's IP address? – Darren Nov 06 '14 at 10:56
-
1@Darren - I am not aware of it But,here is a question related to your quest.http://stackoverflow.com/q/21945498/730807 – Durai Amuthan.H Nov 07 '14 at 09:12
-
1Why is no one saying how amazing this answer was? This should be the accepted answer. It works. – inigo333 Nov 02 '16 at 10:14
0
-
Thanks, that helps a lot. Is it also possible to get the BSSIDs of all available access points instead of only the one I'm currently connected to? – Sep 22 '09 at 16:37
-
Thats what this will do - the NSDictionary networks contains a list of all the visible networks – James Sep 22 '09 at 18:37
-
I've found this post seeking for a way to get the access point MAC Address for a Wifi network. I'm a bit confused. Using this could cause that app will be rejected for app Store? – Rotten May 03 '11 at 15:00
-
1Because its using a private API it'll get rejected. I mean you can try sneak it past them... – James May 04 '11 at 18:20
-