Created
May 7, 2012 08:46
-
-
Save vuk-nikolic/2626725 to your computer and use it in GitHub Desktop.
How to get current SSID (iOS)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <SystemConfiguration/CaptiveNetwork.h> | |
NSString *currentSSID = @""; | |
CFArrayRef myArray = CNCopySupportedInterfaces(); | |
if (myArray != nil){ | |
NSDictionary* myDict = (NSDictionary *) CNCopyCurrentNetworkInfo(CFArrayGetValueAtIndex(myArray, 0)); | |
if (myDict!=nil){ | |
currentSSID=[myDict valueForKey:@"SSID"]; | |
} else { | |
currentSSID=@"<<NONE>>"; | |
} | |
} else { | |
currentSSID=@"<<NONE>>"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment