获取SSID

导入头文件

#import


获取

- (NSDictionary *)fetchSSIDInfo

{

    NSArray *interfaceNames = CFBridgingRelease(CNCopySupportedInterfaces());

    DebugNSLog(@"%s: Supported interfaces: %@", __func__, interfaceNames);

    NSDictionary *SSIDInfo;

    for(NSString *interfaceName in interfaceNames){

        SSIDInfo = CFBridgingRelease(CNCopyCurrentNetworkInfo((__bridge CFStringRef)interfaceName));

         DebugNSLog(@"%s: %@ => %@", __func__, interfaceName, SSIDInfo);

        BOOL isNotEmpty = SSIDInfo.count > 0;

        if ((isNotEmpty)) {

            break;

        }

        

    }

    return SSIDInfo;

}


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