Hello,
I am developing a private internal Flutter app for our customer, which will not be published on the Apple Store. One of the key features of this app is to collect RF strength metrics to share user experience with the network.
For Android, we successfully implemented the required functionality and are able to collect the following metrics:
Signal strength level (0-4)
Signal strength in dBm
RSSI
RSRQ
Cell ID
Location Area Code
Carrier name
Mobile country code
Mobile network code
Radio access technology
Connection status
Duplex mode
However, for iOS, we are facing challenges with CoreTelephony, which is not returning the necessary data. We are aware that CoreTelephony is deprecated and are looking for alternatives.
We noticed that a lot of the information we need is available via FTMInternal-4. Is there a way to access this data for a private app? Are there any other recommended approaches or frameworks that can be used to gather cellular network information on iOS for an app that won't be distributed via the Apple Store?
my swift code
import Foundation
import CoreTelephony
class RfSignalStrengthImpl: RfSignalStrengthApi {
func getCellularSignalStrength(completion: @escaping (Result<CellularSignalStrength, Error>) -> Void) {
let networkInfo = CTTelephonyNetworkInfo()
guard let carrier = networkInfo.serviceSubscriberCellularProviders?.values.first else {
completion(.failure(NSError(domain: "com.xxxx.yyyy", code: 0, userInfo: [NSLocalizedDescriptionKey: "Carrier not found"])))
return
}
let carrierName = carrier.carrierName ?? "Unknown"
let mobileCountryCode = carrier.mobileCountryCode ?? "Unknown"
let mobileNetworkCode = carrier.mobileNetworkCode ?? "Unknown"
let radioAccessTechnology = networkInfo.serviceCurrentRadioAccessTechnology?.values.first ?? "Unknown"
var connectionStatus = "Unknown"
...
...
}
Thank you for your assistance.
Can MetricKit support collecting these specific metrics at such frequent intervals?
Unfortunately that iOS Network Signal Strength post already calls out MetricKit as an approach that won’t help. Note that MXCellularConditionMetric
contains only a single property (see histogrammedCellularConditionTime
at link) which is basically a crude bar chart of signal strengths aggregated over the 24-hour reporting period. There’s no API to get at the underlying data points or timestamps, and note this metric deals in signal bars rather than actual dBm units.
I'm curious about how such an [internal Apple] app might collect data that is otherwise inaccessible through public APIs.
Apple’s built-in apps can use whatever private APIs they want, and in many cases the OS has the means to allow access to such APIs by only specific apps (i.e. theirs or carrier apps) that are entitled to do so. For the specific case of accessing low level telephony data, the restriction was added as a security fix way back in iOS version 8.3 or so. So even if you had the secret header files or documentation, the code wouldn’t actually work without your app having that special entitlement which will never be available.
is there any leeway or additional tools available for private/internal applications to gather more detailed cellular metrics?
Nothing that would be documented by Apple or suitable for discussion on this forum.