I am looking for ways to get the raw signal of the wifi, the dBm on iPhone X phones, but can only find how to get the numberOfActiveBars
from: Answer
Trying @Mosbash answer, getting a crash.
Thread 1: EXC_BAD_ACCESS (code=1, address=0x18)
Code:
class ViewController: UIViewController {
var hotspot: NEHotspotNetwork!
func viewDidLoad() {
....
hotspot = NEHotspotNetwork()
}
func record() {
hotspot.setConfidence(.high) /// <- Crash
print(hotspot.signalStrength) /// <- Crash if above line is commented out
}
}
You can use signalStrength from NEHotspotNetwork as described here https://developer.apple.com/documentation/networkextension/nehotspotnetwork/1618923-signalstrength
Here is the formula to convert Wifi Signal Strength Percentage to RSSI dBm:
See this answer for more details: How to convert Wifi signal strength from Quality (percent) to RSSI (dBm)?