If yes, can we also get additional information about the network configuration?
One useful way to do this could be getting the SSID of the current network. Is there an API to do that?
Update: I found a similar question here:
Can the iPhone SDK obtain the Wi-Fi SSID currently connected to?
Open the Keychain Access app desribed above. On the left, in the Keychains box, click "iCloud". In the main display, click on "Kind" to sort all entries by kind. All the wifi networks will now be listed together with the kind "AirPort network password".
Start by going to Settings > Network & Internet > Wi-Fi, where you can find and click the Manage Known Networks link to see your list of saved wireless networks.
On an Android phone this is achieved by swiping down from the top of the screen to open the Notifications pane. You'll see a Wi-Fi icon which you'll need to tap and hold. This will then open the Wi-Fi section. iPhone and iPad users can go to Settings > Wi-Fi.
Try following method:
#import <SystemConfiguration/CaptiveNetwork.h>
NSString *wifiName = @"Not Found";
CFArrayRef myArray = CNCopySupportedInterfaces();
if (myArray != nil) {
CFDictionaryRef myDict = CNCopyCurrentNetworkInfo(CFArrayGetValueAtIndex(myArray, 0));
if (myDict != nil) {
NSDictionary *dict = (NSDictionary*)CFBridgingRelease(myDict);
wifiName = [dict valueForKey:@"SSID"];
}
}
NSLog(@"wifiName:%@", wifiName);
(Separate answer to preserve history etc.)
It looks like you might not be able to determine the SSID of the WLAN to which you're connected, at least in an app that will go into the App Store. These people use a private API - Preferences.framework - to get to the details of the WLAN (like "is it hidden?" "What's the name?" etc.).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With