mirror of
https://gitee.com/shuto/cordova-plugin-network-information.git
synced 2025-01-31 18:47:21 +08:00
Adding notification for CT radio information
This commit is contained in:
parent
791d828fd4
commit
3bf19c4c02
@ -58,30 +58,32 @@
|
||||
if (isConnectionRequired) {
|
||||
return @"none";
|
||||
} else {
|
||||
CTTelephonyNetworkInfo *telephonyInfo = [CTTelephonyNetworkInfo new];
|
||||
if ([telephonyInfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyGPRS]) {
|
||||
return @"2g";
|
||||
} else if ([telephonyInfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyEdge]) {
|
||||
return @"2g";
|
||||
} else if ([telephonyInfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyWCDMA]) {
|
||||
return @"3g";
|
||||
} else if ([telephonyInfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyHSDPA]) {
|
||||
return @"3g";
|
||||
} else if ([telephonyInfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyHSUPA]) {
|
||||
return @"3g";
|
||||
} else if ([telephonyInfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyCDMA1x]) {
|
||||
return @"3g";
|
||||
} else if ([telephonyInfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyCDMAEVDORev0]) {
|
||||
return @"3g";
|
||||
} else if ([telephonyInfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyCDMAEVDORevA]) {
|
||||
return @"3g";
|
||||
} else if ([telephonyInfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyCDMAEVDORevB]) {
|
||||
return @"3g";
|
||||
} else if ([telephonyInfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyeHRPD]) {
|
||||
return @"3g";
|
||||
} else if ([telephonyInfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyLTE]) {
|
||||
return @"4g";
|
||||
}
|
||||
if ([[[UIDevice currentDevice] systemVersion] compare:@"7.0" options:NSNumericSearch] != NSOrderedAscending) {
|
||||
CTTelephonyNetworkInfo *telephonyInfo = [CTTelephonyNetworkInfo new];
|
||||
if ([telephonyInfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyGPRS]) {
|
||||
return @"2g";
|
||||
} else if ([telephonyInfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyEdge]) {
|
||||
return @"2g";
|
||||
} else if ([telephonyInfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyWCDMA]) {
|
||||
return @"3g";
|
||||
} else if ([telephonyInfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyHSDPA]) {
|
||||
return @"3g";
|
||||
} else if ([telephonyInfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyHSUPA]) {
|
||||
return @"3g";
|
||||
} else if ([telephonyInfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyCDMA1x]) {
|
||||
return @"3g";
|
||||
} else if ([telephonyInfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyCDMAEVDORev0]) {
|
||||
return @"3g";
|
||||
} else if ([telephonyInfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyCDMAEVDORevA]) {
|
||||
return @"3g";
|
||||
} else if ([telephonyInfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyCDMAEVDORevB]) {
|
||||
return @"3g";
|
||||
} else if ([telephonyInfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyeHRPD]) {
|
||||
return @"3g";
|
||||
} else if ([telephonyInfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyLTE]) {
|
||||
return @"4g";
|
||||
}
|
||||
}
|
||||
return @"cellular";
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user