获取WIFI的SSID

阅读更多
#import 

- (id)fetchSSIDInfo {
    NSArray *ifs = (__bridge_transfer id)CNCopySupportedInterfaces();
    id info = nil;
    for (NSString *ifname in ifs) {
        info = (__bridge_transfer id)CNCopyCurrentNetworkInfo((__bridge CFStringRef)ifname);
        if (info && [info count]) { break; }
    }
    
    return info;
}

NSDictionary *ifs = [self fetchSSIDInfo];
NSLog(@"SSID:%@", ifs[@"SSID"]);

 

你可能感兴趣的:(iOS,SSID)