Adding notification for CT radio information

This commit is contained in:
edparsons 2015-12-28 10:18:01 +00:00
parent 791d828fd4
commit 3bf19c4c02

View File

@ -58,6 +58,7 @@
if (isConnectionRequired) { if (isConnectionRequired) {
return @"none"; return @"none";
} else { } else {
if ([[[UIDevice currentDevice] systemVersion] compare:@"7.0" options:NSNumericSearch] != NSOrderedAscending) {
CTTelephonyNetworkInfo *telephonyInfo = [CTTelephonyNetworkInfo new]; CTTelephonyNetworkInfo *telephonyInfo = [CTTelephonyNetworkInfo new];
if ([telephonyInfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyGPRS]) { if ([telephonyInfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyGPRS]) {
return @"2g"; return @"2g";
@ -82,6 +83,7 @@
} else if ([telephonyInfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyLTE]) { } else if ([telephonyInfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyLTE]) {
return @"4g"; return @"4g";
} }
}
return @"cellular"; return @"cellular";
} }
} }