Skip to content

Instantly share code, notes, and snippets.

@edwardean
Forked from tonycn/gist:f877044ebdf80599cb26
Last active December 18, 2015 07:18
Show Gist options
  • Save edwardean/e3c4dd4bf01ab723c2ee to your computer and use it in GitHub Desktop.
Save edwardean/e3c4dd4bf01ab723c2ee to your computer and use it in GitHub Desktop.
iOS SSID
NSString *currentSSID = @"";
CFArrayRef myArray = CNCopySupportedInterfaces();
if (myArray != nil){
NSDictionary* myDict = (__bridge 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