IOS Signal strength issue

Our App demands a functionality to fetch the signal strength quality of the ISPs (both Mobile data and Wifi). We are using SwiftUI for development purpose.   Below mentioned mechanism (code snippet) was working fine with the previous iOS versions (Up to iOS 15)

 func getSignalStrength() -> Int{
var signal : Int = 0
do {
if let statusBarManager = UIApplication.shared.windows.filter({$0.isKeyWindow}).first?.windowScene?.statusBarManager,
let localStatusBar = statusBarManager.value(forKey: "createLocalStatusBar") as? NSObject,
let statusBar = localStatusBar.value(forKey: "statusBar") as? NSObject,
let _statusBar = statusBar.value(forKey: "_statusBar") as? UIView,
let currentData = _statusBar.value(forKey: "currentData") as? NSObject,
let cellEntry = currentData.value(forKey: "cellularEntry") as? NSObject,
let wifiEntry = currentData.value(forKey: "wifiEntry") as? NSObject,
let wifiEnabled = try? ((wifiEntry.value(forKey: "isEnabled") as? Bool) == true),
var strength = (wifiEnabled == true ? wifiEntry : cellEntry).value(forKey: "displayValue") as? Int {
self.networkType = wifiEnabled == true ? "WIFI" : "CELL"
debugPrint("SIGNAL STRENGTH : \(signal)")
 
if (wifiEnabled == true){
strength = strength == 3 ? 4 : strength
}else {
strength = strength - 1
}
signal = strength
}
}
catch let error {
debugPrint("SIGNAL STRENGTH : \(signal)")
}
debugPrint("SIGNAL STRENGTH : \(signal)")
return signal
}

  But` unfortunately, this is not working with the latest iOS 16 or 16.0.2 versions.   Please advise on this.

Apple don't provide a way of getting the signal strength quality.

I am amazed at your ingenious workaround, to retrieve it from the StatusBar...
...but I'm not surprised that Apple have now closed that loophole.

Your attempt to get "localStatusBar" from "statusBarManager" is failing, so I guess this is no longer available.

I wrote this up properly as iOS Network Signal Strength.

IOS Signal strength issue
 
 
Q