4

1). I want to get all list of wi-fi SSID programmatically in iphone.

I try following code but it give only connected SSID detail.

NSArray *ifs = (id)CNCopySupportedInterfaces();
NSLog(@"%s: Supported interfaces: %@", __func__, ifs);
id info = nil;
for (NSString *ifnam in ifs) {
    info = (id)CNCopyCurrentNetworkInfo((CFStringRef)ifnam);
    NSLog(@"%s: %@ => %@", __func__, ifnam, info);
    if (info && [info count]) {
        break;
    }
    [info release];
}

2). Another question is that how can I identify that if I am come range in wi-fi when my wi-fi is OFF. Is it possible to identify that I am in range of wi-fi when wi-fi is OFF ?

Cœur
  • 37,241
  • 25
  • 195
  • 267
kels
  • 269
  • 6
  • 21
  • 1. [Alljoyn](https://www.alljoyn.org/forums/developers/there-way-find-all-users-same-wifi-network-using-ios-version) and [On Google](https://www.google.co.in/?gws_rd=cr#sclient=psy-ab&q=list+of+wi-fi+SSID+programatically+%2B+ios&oq=list+of+wi-fi+SSID+programatically+%2B+ios&gs_l=hp.3...331687.333104.1.333279.7.7.0.0.0.0.240.1327.2-6.6.0....0.0..1c.1j2.20.psy-ab.nl-EaCS_TvM&pbx=1&bav=on.2,or.r_cp.r_qf.&bvm=bv.49478099%2Cd.bmk%2Cpv.xjs.s.en_US.c75bKy5EQ0A.O&fp=548a6aa251bed8a4&biw=1019&bih=625) 2. You can use [Reachability](https://github.com/belkevich/reachability-ios). – TheTiger Jul 18 '13 at 09:18

1 Answers1

1

1) You can only get details about your current network, such as SSID or BSSID, using the CaptiveNetwork Framework that you're already using in your example. Apple doesn't allow developers to seek other networks in addition to the one the user is currently connected.

2) According to the Reachability page, you can use that library to check if the user is currently connected via 3G or WiFi. You can't know if you are in range when Wi-Fi is set to Off.

Nicola Giancecchi
  • 3,045
  • 2
  • 25
  • 41