Skip to content

Instantly share code, notes, and snippets.

@ichitaso
Forked from vuk-nikolic/ssid-finder.m
Created August 5, 2013 11:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ichitaso/6155353 to your computer and use it in GitHub Desktop.
Save ichitaso/6155353 to your computer and use it in GitHub Desktop.
#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