diff options
Diffstat (limited to 'iPhone/CordovaLib/Classes/CDVConnection.m')
-rwxr-xr-x | iPhone/CordovaLib/Classes/CDVConnection.m | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/iPhone/CordovaLib/Classes/CDVConnection.m b/iPhone/CordovaLib/Classes/CDVConnection.m index 3030711..b3f5cab 100755 --- a/iPhone/CordovaLib/Classes/CDVConnection.m +++ b/iPhone/CordovaLib/Classes/CDVConnection.m @@ -52,7 +52,8 @@ return @"none"; case ReachableViaWWAN: - return @"2g"; // no generic default, so we use the lowest common denominator + // Return value of '2g' is deprecated as of 2.6.0 and will be replaced with 'cellular' in 3.0.0 + return @"2g"; case ReachableViaWiFi: return @"wifi"; @@ -66,7 +67,8 @@ { return [theConnectionType isEqualToString:@"2g"] || [theConnectionType isEqualToString:@"3g"] || - [theConnectionType isEqualToString:@"4g"]; + [theConnectionType isEqualToString:@"4g"] || + [theConnectionType isEqualToString:@"cellular"]; } - (void)updateReachability:(CDVReachability*)reachability @@ -111,6 +113,7 @@ self.internetReach = [CDVReachability reachabilityForInternetConnection]; self.connectionType = [self w3cConnectionTypeFor:self.internetReach]; [self.internetReach startNotifier]; + [self printDeprecationNotice]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateConnectionType:) name:kReachabilityChangedNotification object:nil]; if (&UIApplicationDidEnterBackgroundNotification && &UIApplicationWillEnterForegroundNotification) { @@ -121,4 +124,9 @@ return self; } +- (void)printDeprecationNotice +{ + NSLog(@"DEPRECATION NOTICE: The Connection ReachableViaWWAN return value of '2g' is deprecated as of Cordova version 2.6.0 and will be changed to 'cellular' in a future release. "); +} + @end |