获取本机连接的wifi名


/**
 *  获取本机连接的wifi名
 *
 *  @return 本机连接的wifi名
 */
- (NSString*)currentSSID{
    
    NSString *ssid = @"";
    NSArray *ifs = (__bridge id)CNCopySupportedInterfaces();
    
    for (NSString *ifnam in ifs) {
        NSDictionary *info = (__bridge id)CNCopyCurrentNetworkInfo((__bridge CFStringRef)ifnam);
        if(info && [info count]){
            ssid = [info objectForKey:@"SSID"];
            info = nil;
            break;
        }
        info = nil;
    }
    return ssid;
}


你可能感兴趣的:(ios,iOSWIFI,当前连接WIFI名字)