【iOS开发】获取wifi的SSID

#import <SystemConfiguration/CaptiveNetwork.h>

NSArray *ifs = (__bridge_transfer id)CNCopySupportedInterfaces();

    NSLog(@"Supported interfaces: %@", ifs);

    id info = nil;

    for (NSString *ifnam in ifs) {

        info = (__bridge_transfer id)CNCopyCurrentNetworkInfo((__bridge CFStringRef)ifnam);

        NSLog(@"%@ => %@", ifnam, info);  //单个数据info[@"SSID"]; info[@"BSSID"];

        if (info && [info count]) { break; }

    }

  

你可能感兴趣的:(ios开发)