2017-06-20 1 views

Antwort

2

Okay also, um diese Informationen zu erhalten, müssen Sie ein "nicht natives" Plugin für ionische verwenden. Ich habe das one versucht. Dann habe ich in meiner app.component.ts eine neue Variable vor der Komponente selbst deklariert.

declare var WifiInfo

dann in meinem app Konstruktor nach der Plattform bereit ich es wie folgt verwenden.

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)); 
    }); 

in der Konsole Sie die WiFi-info mac sehen usw. enter image description here