I want to observe network changes from 4G to 5G use the following code:
if (@available(iOS 12.0, *)) {
[[NSNotificationCenter defaultCenter] addObserverForName:CTServiceRadioAccessTechnologyDidChangeNotification object:nil queue:nil usingBlock:^(NSNotification * _Nonnull note) {
}];
}
When I switch my phone's network from 4G to 5G, it do not work。but when I switch my network between 3G and 4G, it did work.
when I switch network to 5G,
I run CTTelephonyNetworkInfo.new.serviceCurrentRadioAccessTechnology
,it did return CTRadioAccessTechnologyNR
which is 5G。
Question
- is there a bug on
CTServiceRadioAccessTechnologyDidChangeNotification
when net changes between 4G and 5G? - is there a way to know network changes between 4G and 5G? Exclude polling。