Ionic2 获取ionic 2中连接到的wifi点设备的mac地址

Ionic2 获取ionic 2中连接到的wifi点设备的mac地址,ionic2,Ionic2,我想知道如何在ionic 2中获取设备连接到的wifi网络点的mac地址 我知道有一个类似的答案,但它适用于爱奥尼亚1号。好的,为了获得这些信息,你需要使用爱奥尼亚的“非本地”插件。我试过这个。然后在我的app.component.ts中,我在组件本身之前声明了一个新变量 声明var WifiInfo 然后在我的应用程序构造器中,在平台准备就绪后,我像这样使用它 this.platform.ready() .then(() => { // Okay, so the

我想知道如何在ionic 2中获取设备连接到的wifi网络点的mac地址


我知道有一个类似的答案,但它适用于爱奥尼亚1号。

好的,为了获得这些信息,你需要使用爱奥尼亚的“非本地”插件。我试过这个。然后在我的app.component.ts中,我在组件本身之前声明了一个新变量

声明var WifiInfo

然后在我的应用程序构造器中,在平台准备就绪后,我像这样使用它

this.platform.ready()
    .then(() => {
        // Okay, so the platform is ready and our plugins are available.
        // Here you can do any higher level native things
        // you might need.
        this.statusBar.styleDefault();
        this.splashScreen.hide();

        // console log an object with wifi info
        WifiInfo.getWifiInfo(wifiInfo => console.log(wifiInfo),
            wifiError => console.log(wifiError));
    });
在控制台中,您将看到wifi信息mac等