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 2013/03/14 20:07:12 UTC
ios commit: CB-2491: Deprecate current Connection cell setting
Updated Branches:
refs/heads/master 37e9e16ad -> 32f1260eb
CB-2491: Deprecate current Connection cell setting
- adds deprecation notice and recognize CELL setting
Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/32f1260e
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/32f1260e
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/32f1260e
Branch: refs/heads/master
Commit: 32f1260eb0784265a17a4b4d43d3e16ac541b5bf
Parents: 37e9e16
Author: James Jong <wj...@gmail.com>
Authored: Thu Mar 14 07:36:37 2013 -0400
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Thu Mar 14 12:06:46 2013 -0700
----------------------------------------------------------------------
CordovaLib/Classes/CDVConnection.m | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/32f1260e/CordovaLib/Classes/CDVConnection.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVConnection.m b/CordovaLib/Classes/CDVConnection.m
index 3030711..3a534b0 100644
--- a/CordovaLib/Classes/CDVConnection.m
+++ b/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