本来决定开始使用这套模式来做APP,但是现在遇到一个小问题。如何通过Native.js 的ios接口实现在IOS里面获取wifi模块的MAC地址,我们在Andriod已经实现了。但是IOS不知道如何弄。请教如何用Native.js 实现以下原生代码:
import <SystemConfiguration/CaptiveNetwork.h>
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];
JimmyHezheng (作者)
function getMac(){
var mac = "xxx-xxx-xxx-xxx";
if(plus.os.name=="Android"){
// 导入UIAlertView类
//WifiManager
2014-11-28 09:09
JimmyHezheng (作者)
IOS的部分@697 麻烦帮忙看一下,真心不熟悉。
2014-11-28 09:09
DCloud_IOS_XTY
iOS获取mac地址已经被apple封杀,获取不到
2014-11-28 14:31