cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabb...@apache.org
Subject [2/4] cordova-plugin-network-information git commit: Adding notification for CT radio information
Date Fri, 08 Jan 2016 22:42:39 GMT
Adding notification for CT radio information

Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information/commit/3bf19c4c
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information/tree/3bf19c4c
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information/diff/3bf19c4c

Branch: refs/heads/master
Commit: 3bf19c4c02ccd762eef069a0eae54d7abbe846a9
Parents: 791d828
Author: edparsons <edwardparsons2@hotmail.com>
Authored: Mon Dec 28 10:18:01 2015 +0000
Committer: edparsons <edwardparsons2@hotmail.com>
Committed: Mon Dec 28 10:18:01 2015 +0000

----------------------------------------------------------------------
 src/ios/CDVConnection.m | 50 +++++++++++++++++++++++---------------------
 1 file changed, 26 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information/blob/3bf19c4c/src/ios/CDVConnection.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVConnection.m b/src/ios/CDVConnection.m
index 2bcaa66..6715322 100644
--- a/src/ios/CDVConnection.m
+++ b/src/ios/CDVConnection.m
@@ -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";
             }
         }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message