How to use NEHotspotNetwork.signalStrength?

I need to develop an extension that gets the current connected Wi-Fi signal strength, the app will be registered as a Hotspot Helper, but first, we need to do some testing.


I don't see too much documentation about this and I don't know how to use the object.

Sure. When NEHotspotHelper finds a network it interprets it as a NEHotspotNetwork. One of the properties on the NEHotspotNetwork is signalStrength, which correlates to RSSI but in a more digestible manner. For example, RSSI usually is presented as a negative range of numbers -60, -75, etc... and there is a threshold to which it becomes increasingly difficult to make a reliable connection to an access point. This is what signal strength represents, but on a scale for 0.0 to 1.0. With 1.0 being excellent signal strength and 0.0 being no signal strength.


Take a look here at the NEHotspotNetwork documentation.


Matt Eaton

DTS Engineering, CoreOS

meaton3 at apple.com

except that the signal strength returned is always zero. I have whenInUseAuthorization from CLLocationManager and both the "Access WiFi Information" and "Hotspot Configuration" entitlements are present. Any ideas?

Yes, when NEHotspotNetwork.fetchCurrent is used the signal strength property will not be populated, at least on iOS 14. I have not heard of any changes for this in iOS 15 either, but I have not tested this API on iOS 15. Notice, the header documentation for this API say, "NEHotspotNetwork object contains only valid SSID and BSSID values, when the block is passed non-nil object." The signal strength addition to NEHotspotNetwork in the completion block of fetchCurrent would be an Enhancement Request.

Matt Eaton
DTS Engineering, CoreOS
meaton3@apple.com

Is there any other way to get a valid signal strength … ?

What do you plan to do with the signal strength?

Share and Enjoy

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

Our use case is to show a WiFi indicator for an application in single app mode where the status bar is hidden and locked.

This would be an Enhancement Request when using NEHotspotNetwork.fetchCurrent to get the signal strength.

Matt Eaton
DTS Engineering, CoreOS
meaton3@apple.com

I have tried to use the NEHotspotNetwork.fetchCurrent to get the wifi signal strength and it is returning zero on iOS 16. Request to provide information on which APIs will return the signal strength whenever polled or when it changes

Thanks and Regards

muthulakshmi

This is a bit of a FAQ, and recently I wrote up a detailed response to it: iOS Network Signal Strength.

Share and Enjoy

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

How to use NEHotspotNetwork.signalStrength?
 
 
Q