We did not find any issues calling this api CNCopySupportedInterfaces on main thread specified in any of the apple documents.
Please note we are experiencing this issue only in a particular network environment.
Code snippet :
(NSString *)getwifiName{
CFArrayRef arrayRef = CNCopySupportedInterfaces();
NSArray *interfaces = (_bridge NSArray *)arrayRef;
if (interfaces) {
for (NSString *interfaceName in interfaces) {
CFDictionaryRef dictRef = CNCopyCurrentNetworkInfo((CFStringRef)interfaceName);
if (dictRef != NULL) {
NSDictionary *networkInfo = (bridge NSDictionary *)dictRef;
wifiStr = [NSString stringWithFormat:@"%@",[networkInfo objectForKey:@"SSID"]];
CFRelease(dictRef);
}
}
CFRelease(arrayRef);
}
if(wifiStr == nil)
{
wifiStr = [NSString stringWithFormat:NSLocalizedString(@"MobileDeviceWIFINotEnable",nil)];
}
Code Block NSLog(@"Connected WifiStr - %@",wifiStr);
return wifiStr;
}