标签:http io ar os sp for on log cti
1. 引入头,#import <SystemConfiguration/CaptiveNetwork.h>
2. 获取SSID info
+ (id)fetchSSIDInfo
{
NSArray *ifs = (__bridge id)CNCopySupportedInterfaces();
NSLog(@"%s: Supported interfaces: %@", __func__, ifs);
id info = nil;
for (NSString *ifnam in ifs) {
info = (__bridge id)CNCopyCurrentNetworkInfo((__bridge CFStringRef)ifnam);
if (info && [info count]) {
break;
}
}
return info;
}
3. 调用
NSDictionary *ifs = [AppDelegate fetchSSIDInfo];
NSString *ssid = [[ifs objectForKey:@"SSID"] lowercaseString];
NSLog(@"ssid:%@",ssid);
4.此框架介绍可参照此link http://bobffin.wordpress.com/2013/12/30/ios-captivenetwork-api-的用法/
标签:http io ar os sp for on log cti
原文地址:http://www.cnblogs.com/ouyangfang/p/4088694.html