mirror of
https://gitee.com/shuto/cordova-plugin-network-information.git
synced 2025-03-10 18:31:03 +08:00
CB-8659: ios: 4.0.x Compatibility: Remove use of initWebView method
This commit is contained in:
parent
9e57b0227f
commit
6ae87c9dc0
@ -110,22 +110,18 @@
|
|||||||
[self updateReachability:self.internetReach];
|
[self updateReachability:self.internetReach];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (CDVPlugin*)initWithWebView:(UIWebView*)theWebView
|
- (void)pluginInitialize
|
||||||
{
|
{
|
||||||
self = [super initWithWebView:theWebView];
|
self.connectionType = @"none";
|
||||||
if (self) {
|
self.internetReach = [CDVReachability reachabilityForInternetConnection];
|
||||||
self.connectionType = @"none";
|
self.connectionType = [self w3cConnectionTypeFor:self.internetReach];
|
||||||
self.internetReach = [CDVReachability reachabilityForInternetConnection];
|
[self.internetReach startNotifier];
|
||||||
self.connectionType = [self w3cConnectionTypeFor:self.internetReach];
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateConnectionType:)
|
||||||
[self.internetReach startNotifier];
|
name:kReachabilityChangedNotification object:nil];
|
||||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateConnectionType:)
|
if (&UIApplicationDidEnterBackgroundNotification && &UIApplicationWillEnterForegroundNotification) {
|
||||||
name:kReachabilityChangedNotification object:nil];
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onPause) name:UIApplicationDidEnterBackgroundNotification object:nil];
|
||||||
if (&UIApplicationDidEnterBackgroundNotification && &UIApplicationWillEnterForegroundNotification) {
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onResume) name:UIApplicationWillEnterForegroundNotification object:nil];
|
||||||
[[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
|
@end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user