大熊_Daniel
大熊_Daniel
  • 发布:2016-02-19 11:36
  • 更新:2016-02-19 11:36
  • 阅读:4556

iOS如何获取AP的mac地址以及本机IP地址

分类:Native.js

原生代码已经实现获取。
NSString ssid = @"Not Found";
NSString
macIp = @"Not Found";
CFArrayRef myArray = CNCopySupportedInterfaces();
if (myArray != nil) {
CFDictionaryRef myDict = CNCopyCurrentNetworkInfo(CFArrayGetValueAtIndex(myArray, 0));
if (myDict != nil) {
NSDictionary dict = (NSDictionary)CFBridgingRelease(myDict);

        ssid = [dict valueForKey:@"SSID"];  
        macIp = [dict valueForKey:@"BSSID"];  
    }  
}  
UIAlertView *av = [[UIAlertView alloc] initWithTitle:ssid  
                                             message:macIp  
                                            delegate:nil  
                                   cancelButtonTitle:nil  
                                   otherButtonTitles:@"OK", nil];  
[av show];  

请问如何通过native.js 转换

2016-02-19 11:36 1 条评论 负责人:无 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复