hoerresb / WifiWizard

A Cordova plugin for managing Wifi networks
Apache License 2.0
205 stars 177 forks source link

getCurrentSSID on android adds extra quotes on ssid return value #119

Open predorock opened 6 years ago

predorock commented 6 years ago

Example code:

wifi.getCurrentSSID(function (ssid) {
    if (ssid) {
         if(ssid === $ctrl.ssid) {
             // ... my stuff
         } else {
             // ... error handling
         }
    }

For example my home wifi is FASTWEB-12345, so when connected I am expecting to get in the ssid variable the string "FASTWEB-12345", but the value is ""FASTWEB-12345"". Note that on iOS is working correctly, this bug is affecting only the android version.

tripflex commented 6 years ago

Yes this is related specifically to Android as it required the SSID to be enclosed in double quotes, and is probably why it's returning it that way.... but yes would be good for actual repo to do it for you.

Check out this fork that's more recent, and i'll be pushing fixes to shortly https://github.com/arsenal942/Cordova-Network-Manager