I need to get the name of the currently connected Wi-Fi hotspot, e.g. \"BT OpenZone\"
I have been told it can be done with CaptiveNetwork specifically CNCopyCurrentN
Add SystemConfiguration.framework
import < SystemConfiguration/CaptiveNetwork.h>
use the below method
+ (NSString *)GetCurrentWifiHotSpotName {
NSString *wifiName = nil;
NSArray *ifs = (__bridge_transfer id)CNCopySupportedInterfaces();
for (NSString *ifnam in ifs) {
NSDictionary *info = (__bridge_transfer id)CNCopyCurrentNetworkInfo((__bridge CFStringRef)ifnam);
NSLog(@"info:%@",info);
if (info[@"SSID"]) {
wifiName = info[@"SSID"];
}
}
return wifiName;
}