I have this app which is coded in Objective C. In my app there is a scenario in which I want to list out all the available Wi-Fi networks available to connect with my iPad. When I googled it I found out the private APIs are the only one option. Is there any other way with which I can show all the available Wi-Fi networks? I found a way to show the already connected WiFi connection name and details. But I want the Wi-Fi available connection list in my App. Thanks in advance. Happy Coding.
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"];
if(([wifiName rangeOfString:@"WA"].location == NSNotFound))
{
_textfield.textColor=[UIColor redColor];
_textfield.text=@"";
_textfield.hidden=YES;
}
else
{
_textfield.textColor=[UIColor blackColor];
_textfield.text=wifiName;
_textfield.hidden=NO;