get signal strength is not working in ios 16

Here i posted code that is working till ios 15

     if let statusBarManager = UIApplication.shared.keyWindow?.windowScene?.statusBarManager,

 let localStatusBar = statusBarManager.value(forKey: "createLocalStatusBar") as? AnyObject,

       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 celluar = currentData.value(forKey: "cellularEntry") as? NSObject,

       let signalStrength = celluar.value(forKey: "displayValue") as? Int { print(signalStrength)

}

Answered by DTS Engineer in 747490022

To build on MobileTen’s response…

iOS has no supported API to get real-time cellular signal strength [1]. Out there on the ’net you will find various folks promulgating various unsupported techniques for this. These are likely to break as we tighten up platform security.

The situation for Wi-Fi is more nuanced but your code and tags suggest that your focus is cellular.


Taking a step back, why do you need this info? What would you do with it once you got it.

Share and Enjoy

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

[1] You can get aggregate info from the MXCellularConditionMetric class.

That's the beauty of private APIs. You use them at your own risk. Maybe switch to checking for the strength using this API instead WiFi: https://developer.apple.com/documentation/networkextension/nehotspotnetwork/1618923-signalstrength Permission is required for obvious reasons: https://developer.apple.com/documentation/networkextension/hotspot_helper

Accepted Answer

To build on MobileTen’s response…

iOS has no supported API to get real-time cellular signal strength [1]. Out there on the ’net you will find various folks promulgating various unsupported techniques for this. These are likely to break as we tighten up platform security.

The situation for Wi-Fi is more nuanced but your code and tags suggest that your focus is cellular.


Taking a step back, why do you need this info? What would you do with it once you got it.

Share and Enjoy

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

[1] You can get aggregate info from the MXCellularConditionMetric class.

Thanks for reply.

But need Cellular network signal strength for iOS 16.If you have any suggestion for this please share.

thanks

Thanks for the reply,

But need a signal bar for cellular network. If you have any suggestion for this please share.

Thank you.

Hello eskimo ,

Thank for the reply.

We need this info because we need to map some data for iOT project.So Please provide any information regarding cellular signal bar if you have.

Do you have any link or demo for MXCellularConditionMetric class for getting cellular signal bar?

Please share information if you have.

Thank you.

We need this info because we need to map some data for iOT project.

That’s not a lot of detail. Please elaborate.

Please provide any information regarding cellular signal bar if you have.

Once more with emphasis…

iOS has no supported API to get real-time cellular signal strength.

Do you have any link or demo for MXCellularConditionMetric class for getting cellular signal bar?

Not handy, but my experience is that MetricKit is a very easy API to use. A good place to start is WWDC 2019 Session 417 Improving Battery Life and Performance.

But, just to be clear, MetricKit does not provide real-time cellular signal strength.

Share and Enjoy

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

I think @eskimo actually meant to say:

> But, just to be clear, MetricKit does NOT provide real-time cellular signal strength.

get signal strength is not working in ios 16
 
 
Q