You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2014/03/24 23:52:59 UTC

git commit: CB-6342 - iOS reports a cellular connection even when in Airplane mode

Repository: cordova-plugin-network-information
Updated Branches:
  refs/heads/dev d2cd2fbb6 -> 6831f0668


CB-6342 - iOS reports a cellular connection even when in Airplane mode


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/6831f066
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information/tree/6831f066
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information/diff/6831f066

Branch: refs/heads/dev
Commit: 6831f06685076dbbded4e78b2b89a09ee885f8fe
Parents: d2cd2fb
Author: Elad Katan <el...@hp.com>
Authored: Mon Mar 24 11:39:28 2014 +0200
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Mon Mar 24 15:52:12 2014 -0700

----------------------------------------------------------------------
 src/ios/CDVConnection.m | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information/blob/6831f066/src/ios/CDVConnection.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVConnection.m b/src/ios/CDVConnection.m
index 3cfdc33..cbf4d69 100644
--- a/src/ios/CDVConnection.m
+++ b/src/ios/CDVConnection.m
@@ -52,8 +52,14 @@
             return @"none";
 
         case ReachableViaWWAN:
-            return @"cellular";
-
+        {
+            BOOL isConnectionRequired = [reachability connectionRequired];
+            if (isConnectionRequired) {
+                return @"none";
+            } else {
+                return @"cellular";
+            }
+        }
         case ReachableViaWiFi:
             return @"wifi";