I wanted to know the signal strength in dBm in iOS 13 Swift. I went through most of the forum related to getting network signal streanth in iOS but none of them is working correctly
I tried using NetworkExtension but it is returning nil value
NEHotspotHelper.supportedNetworkInterfaces
I tried using statusbar, but it is crashing
let app = UIApplication.shared
var rssi: Int?
guard let statusBar = app.value(forKey: "statusBar") as? UIView, let foregroundView = statusBar.value(forKey: "foregroundView") as? UIView else {
return rssi
}
for view in foregroundView.subviews {
if let statusBarDataNetworkItemView = NSClassFromString("UIStatusBarDataNetworkItemView"), view .isKind(of: statusBarDataNetworkItemView) {
if let val = view.value(forKey: "wifiStrengthRaw") as? Int {
//print("rssi: \(val)")
rssi = val
break
}
}
}
return rssi
I tried using CTTelephonyNetworkInfo, but there is no option to get the dbm value.
I wanted to know the mobile data usage (singal strength) . Once the mobile data (singal strength) goes down, my application should stop the process.