CoreWLAN or any other public API for IOS 7

1.2k views Asked by At

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?

1

There are 1 answers

0
HiDeoo On BEST ANSWER

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;
}