MQTT协议中文版
获取当前wifi名称
引入框架:SystemConfiguration.framework
导入头文件:#import <SystemConfiguration/CaptiveNetwork.h>
//一键配置获取SSID
#import <SystemConfiguration/CaptiveNetwork.h>
-(NSString *)getDeviceSSID
{
NSArray *ifs = (__bridge id)CNCopySupportedInterfaces();
id info = nil;
for (NSString *ifnam in ifs) {
info = (__bridge id)CNCopyCurrentNetworkInfo((__bridge CFStringRef)ifnam);
if (info && [info count]) {
break;
}
}
NSDictionary *dctySSID = (NSDictionary *)info;
NSString *ssid = [dctySSID objectForKey:@"SSID"];
return ssid;
}