获取的WiFi点设备的MAC地址连接到离子2
答
好吧,所以为了得到这个信息,你需要使用一个非本地插件的离子。我试过这个one。然后在我的app.component.ts中,我在组件本身之前声明了一个新的变量。
declare 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));
});