//ios中获取手机当前连接的wifi名称,即ssid,注意需要导入头文件
//#import <SystemConfiguration/CaptiveNetwork.h>
- (NSString *)getCurrentConnectSsid {
NSString *currentSsid = @"未知";
CFArrayRef myArray = CNCopySupportedInterfaces();
if (myArray != nil) {
CFDictionaryRef myDict = CNCopyCurrentNetworkInfo(CFArrayGetValueAtIndex(myArray, 0));
if (myDict != nil) {
NSDictionary *dict = (__bridge NSDictionary *)(myDict);
currentSsid = [dict valueForKey:@"SSID"];
}
}
return currentSsid;
}
ios系统获取ssid
最新推荐文章于 2021-12-13 16:37:10 发布