cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i..@apache.org
Subject cordova-plugin-network-information git commit: CB-8659: ios: 4.0.x Compatibility: Remove use of initWebView method
Date Fri, 13 Mar 2015 15:03:36 GMT
Repository: cordova-plugin-network-information
Updated Branches:
  refs/heads/master 9e57b0227 -> 6ae87c9dc


CB-8659: ios: 4.0.x Compatibility: Remove use of initWebView method


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

Branch: refs/heads/master
Commit: 6ae87c9dc05e5feb6650f17b321fd9807841fc0d
Parents: 9e57b02
Author: Ian Clelland <iclelland@chromium.org>
Authored: Fri Mar 13 11:03:29 2015 -0400
Committer: Ian Clelland <iclelland@chromium.org>
Committed: Fri Mar 13 11:03:29 2015 -0400

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


http://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information/blob/6ae87c9d/src/ios/CDVConnection.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVConnection.m b/src/ios/CDVConnection.m
index cbf4d69..3749767 100644
--- a/src/ios/CDVConnection.m
+++ b/src/ios/CDVConnection.m
@@ -110,22 +110,18 @@
     [self updateReachability:self.internetReach];
 }
 
-- (CDVPlugin*)initWithWebView:(UIWebView*)theWebView
+- (void)pluginInitialize
 {
-    self = [super initWithWebView:theWebView];
-    if (self) {
-        self.connectionType = @"none";
-        self.internetReach = [CDVReachability reachabilityForInternetConnection];
-        self.connectionType = [self w3cConnectionTypeFor:self.internetReach];
-        [self.internetReach startNotifier];
-        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateConnectionType:)
-                                                     name:kReachabilityChangedNotification
object:nil];
-        if (&UIApplicationDidEnterBackgroundNotification && &UIApplicationWillEnterForegroundNotification)
{
-            [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onPause)
name:UIApplicationDidEnterBackgroundNotification object:nil];
-            [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onResume)
name:UIApplicationWillEnterForegroundNotification object:nil];
-        }
+    self.connectionType = @"none";
+    self.internetReach = [CDVReachability reachabilityForInternetConnection];
+    self.connectionType = [self w3cConnectionTypeFor:self.internetReach];
+    [self.internetReach startNotifier];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateConnectionType:)
+                                                 name:kReachabilityChangedNotification object:nil];
+    if (&UIApplicationDidEnterBackgroundNotification && &UIApplicationWillEnterForegroundNotification)
{
+        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onPause)
name:UIApplicationDidEnterBackgroundNotification object:nil];
+        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onResume)
name:UIApplicationWillEnterForegroundNotification object:nil];
     }
-    return self;
 }
 
 @end


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


Mime
View raw message