Apple will release the iPhone12 in this year, and the iPhone12(some higher device type) can support the 5G feature, I think the iPhone12 should be based on iOS14 platform, so I looked into the iOS14 APIs, but we can't find any new APIs about the 5G. Does anybody know the some information about 5G detection of the iPhone12?
Appreciated for the information from anybody!
iOS14 API diff: https://developer.apple.com/documentation/technologies?changes=latest_major
Probably you should be looking into CTTelephonyNetworkInfo, where you'll find
serviceCurrentRadioAccessTechnology
, as well ascurrentRadioAccessTechnology
. That should offer you what you want.However, I wouldn't be able to tell you what the key or value for 5G will be. Given they're all Strings though, a new one could just show up and probably a future version of Xcode 12 would add a property to strong type it.
For reference, this SO answer shows how to identify 2G, 3G and 4G.
Later update: Core Telephony Constants has shown up and provides 2 new strings,
CTRadioAccessTechnologyNR
andCTRadioAccessTechnologyNRNSA
, both available from iOS 14+ (reasonable given iPhone 12s are first with the tech). This should be reinforced by the term NR, which seems to be part of 5Gs naming 5G NR (New Radio). I don't have a phone to test today, so still yet to confirm where this property will show up, but I'd still guess withinCTTelephonyNetworkInfo().serviceCurrentRadioAccessTechnology
.For reference, to test this, you need to
import CoreTelephony
.Latest update:
Big thanks to Alessandro Martin for sharing this in the comment: