iOS 获取WiFi bssid ssid 信息

#import 


+ (NSDictionary *)wifiInfo {
    NSArray *ifs = (__bridge_transfer id)CNCopySupportedInterfaces();
    NSLog(@"interfaces:%@",ifs);
    NSDictionary *info = nil;
    for (NSString *ifname in ifs) {
        info = (__bridge_transfer NSDictionary *)CNCopyCurrentNetworkInfo((__bridge CFStringRef)ifname);
        NSLog(@"%@ => %@",ifname,info);
    }
    return info;
}

日志打印

2018-07-08 10:24:55.162377+0800 ssid[19558:6061562] interfaces:(
    en0
)
2018-07-08 10:24:56.064247+0800 ssid[19558:6061562] en0 => {
    BSSID = "94:d9:b3:a6:bc:c3";
    SSID = "dev_keixibao-5G";
    SSIDDATA = <6465765f 6b656978 6962616f 2d3547>;
}
2018-07-08 10:25:01.189019+0800 ssid[19558:6061562] Status bar could not find cached time string image. Rendering in-process.

你可能感兴趣的:(iOS 获取WiFi bssid ssid 信息)