Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CoreWLAN or any other public API for IOS 7

I'm looking for a way to scan available Wi-Fi access points (hotspots) from my IOS-app.

All that I need is a list of active at the moment hotspot names, where a device is able to connect to. Like Safari shows a list of Wi-Fi hotspots when we start or activate it.

I'd like to publish the app on App Store, so I can't use any kind of Private API's (right?). And unfortunatelly CoreWLAN.framework is unavailable for IOS (right?).

So, is it possible to achieve my target? Can I collect available access points names (SSID) some way?

like image 539
Andrew Avatar asked Nov 10 '13 12:11

Andrew


1 Answers

There is no Public APIs at the moment that you can use to get a list of available Wi-Fi access points. As you're planning to publish on the App Store, Private APIs are not an option.

The closest thing you can achieve is getting your currently connected Wi-Fi name and details which can be achievied with CaptiveNetwork with the SystemConfiguration.framework.

+ (NSString *)currentSSID
{
    NSString *ssid;

    NSArray *interfaces = (__bridge_transfer id)CNCopySupportedInterfaces();

    for (NSString *interfaceName in interfaces) {
        NSDictionary *informations = (__bridge_transfer id)CNCopyCurrentNetworkInfo((__bridge CFStringRef)interfaceName);

        if (informations[@"SSID"]) {
            ssid = informations[@"SSID"];
        }
    }

    return ssid;
}
like image 80
HiDeo Avatar answered Sep 30 '22 11:09

HiDeo