Created
May 4, 2014 06:12
-
-
Save nonstriater/6f7f166d86d0a8cbcdb3 to your computer and use it in GitHub Desktop.
iOS 获取当前WIFI名字
This file contains 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
iOS 获取当前WIFI名字 | |
+ (NSString *)GetCurrentWifiHotSpotName { | |
NSString *wifiName = nil; | |
NSArray *ifs = (__bridge_transfer id)CNCopySupportedInterfaces(); | |
for (NSString *ifnam in ifs) { | |
NSDictionary *info = (__bridge_transfer id)CNCopyCurrentNetworkInfo((__bridge CFStringRef)ifnam); | |
NSLog(@"info:%@",info); | |
if (info[@"SSID"]) { wifiName = info[@"SSID"]; } | |
} | |
return wifiName; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment