NEHotspotNetwork fetchCurrent signalStrength always return zero

When I call fetchCurrent on NEHotspotNetwork, I am able to correctly retrieve the SSID and other information, but why do I always receive zero as the signal strength value?

Here my code:

let config = NEHotspotConfiguration(ssid: "mySSID", passphrase: "MyPass", isWEP: false)
            config.joinOnce = true
            NEHotspotConfigurationManager.shared.apply(config) { [weak self] (error) in
                guard let this = self else {
                    print("WiFi network not found")
                    result(false)
                    return
                }
                this.getSSID { (sSSID) -> () in
                    if (error != nil) {
                        if (error?.localizedDescription == "already associated.") {
                            print("Connected to '\(sSSID ?? "<Unknown Network>")'")
                            result(true)
                        } else {
                            print("Not Connected")
                            result(false)
                        }
                    } else if let ssid = sSSID {
                        print("Connected to " + ssid)
                        // ssid check is required because if wifi not found (could not connect) there seems to be no error given
                        result(ssid == sSSID)
                    } else {
                        print("WiFi network not found")
                        result(false)
                    }
                }
            }
        } else {
            print("Not Connected")
            result(nil)
            return
        }
    public func getSSID(result: @escaping (String?) -> ()) {
        if #available(iOS 14.0, *) {
            NEHotspotNetwork.fetchCurrent { currentNetwork in
                result(currentNetwork?.ssid)
            }
        }
    }

why do I always receive zero as the signal strength value?

Because you’re not the chosen hotspot helper for that network. For more background on this, see iOS Network Signal Strength.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

NEHotspotNetwork fetchCurrent signalStrength always return zero
 
 
Q