print all Wi-Fi SSID programmatically in iphone

1). I want to get the entire list of Wi-Fi SSID programmatically in iphone.

I am trying the following code, but it only gives details of the connected SSID.

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 how can I determine this if I enter the Wi-Fi range when my Wi-Fi is turned off. Is it possible to determine that I am in the Wi-Fi range when Wi-Fi is turned off?

+4
source share
1 answer

1) You can get information about your current network, such as SSID or BSSID, using the CaptiveNetwork Framework , which you already use in your example. Apple does not allow developers to search for other networks in addition to the one to which the user is currently connected.

2). On the Reachability page , you can use this library to check if the user is currently connected via 3G or WiFi. You cannot know if you are in a range if Wi-Fi is set to “Off.”

+1
source

Source: https://habr.com/ru/post/1492037/


All Articles