You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2022/06/22 08:39:11 UTC

[GitHub] [cordova-plugin-network-information] ZumelzuR opened a new pull request, #130: 5g feature

ZumelzuR opened a new pull request, #130:
URL: https://github.com/apache/cordova-plugin-network-information/pull/130

   ### Platforms affected
   
   
   
   ### Motivation and Context
         Solve 5g detections for iOS and Android (the current state of the plugin classify as UKNOWN the 5g network)
        open issue -> https://github.com/apache/cordova-plugin-network-information/issues/125
   
   closes #125 
   
   ### Description
        We added a a new listener for check if NR is available and using that, if is the case, detect the 5g.
   
   
   
   ### Testing
           We tested on android simulator and a physical android 10 and iOS simulator
   
   ### Checklist
   
   - [ x ] I've run the tests to see all new and existing tests pass
   - [ x] I added automated test coverage as appropriate for this change
   - [x ] Commit is prefixed with `(platform)` if this change only applies to one platform (e.g. `(android)`)
   - [ x] If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct [keyword to close issues using keywords](https://help.github.com/articles/closing-issues-using-keywords/))
   - [x ] I've updated the documentation if necessary
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [cordova-plugin-network-information] ZumelzuR commented on pull request #130: 5g feature

Posted by GitBox <gi...@apache.org>.
ZumelzuR commented on PR #130:
URL: https://github.com/apache/cordova-plugin-network-information/pull/130#issuecomment-1156178064

   > @ZumelzuR On my iPhone 13 Pro `networkInfo.currentRadioAccessTechnology` is always nil. Strange enough another phone (with the same os version) this pointer is not nil. I found `networkInfo.currentRadioAccessTechnology` is deprecated and can be nil on ios >= 14.2. I`ve found this fix https://github.com/Tencent/Hippy/pull/1597/files. May you can try this and add this to your PR.
   > 
   > _Edit_: May you will use a more reactive form (with a nil check):
   > 
   > ```objc
   > static NSString *radioAccessNameIn(CTTelephonyNetworkInfo *networkInfo) {
   >   if (@available(iOS 13.0, *)) {
   >     if (networkInfo.currentRadioAccessTechnology == nil && networkInfo.dataServiceIdentifier) {
   >         return [networkInfo.serviceCurrentRadioAccessTechnology objectForKey:networkInfo.dataServiceIdentifier]; 
   >     }
   >   }
   >   return networkInfo.currentRadioAccessTechnology;
   > }
   > ```
   
   Thank you, ok yes I will do some testing on my devices and come back  with the fix and an update. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [cordova-plugin-network-information] erisu commented on a diff in pull request #130: 5g feature

Posted by GitBox <gi...@apache.org>.
erisu commented on code in PR #130:
URL: https://github.com/apache/cordova-plugin-network-information/pull/130#discussion_r994691719


##########
src/ios/CDVConnection.m:
##########
@@ -60,28 +60,35 @@ - (NSString*)w3cConnectionTypeFor:(CDVReachability*)reachability
             } else {
                 if ([[[UIDevice currentDevice] systemVersion] compare:@"7.0" options:NSNumericSearch] != NSOrderedAscending) {
                     CTTelephonyNetworkInfo *telephonyInfo = [CTTelephonyNetworkInfo new];
-                    if ([telephonyInfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyGPRS]) {
+                    NSString *currentRadioAccessTechnology = radioAccessNameIn(telephonyInfo);
+                    if ([currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyGPRS]) {
                         return @"2g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyEdge]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyEdge]) {
                         return @"2g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyWCDMA]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyWCDMA]) {
                         return @"3g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyHSDPA]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyHSDPA]) {
                         return @"3g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyHSUPA]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyHSUPA]) {
                         return @"3g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyCDMA1x]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyCDMA1x]) {
                         return @"3g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyCDMAEVDORev0]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyCDMAEVDORev0]) {
                         return @"3g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyCDMAEVDORevA]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyCDMAEVDORevA]) {
                         return @"3g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyCDMAEVDORevB]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyCDMAEVDORevB]) {
                         return @"3g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyeHRPD]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyeHRPD]) {
                         return @"3g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyLTE]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyLTE]) {
                         return @"4g";
+                    } else if (@available(iOS 14.1, *)) {
+                        if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyNRNSA]) {
+                            return @"5g";
+                        } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyNR]) {
+                            return @"5g";
+                        }

Review Comment:
   The tests is failing because `CTRadioAccessTechnologyNRNSA` and `CTRadioAccessTechnologyNR` cant be seen with the version of Xcode that is compiling for iOS 13.
   
   You might want want to test it with something like this.
   ```suggestion
                       } 
                       #if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_14_1 
                       else if (@available(iOS 14.1, *)) {
                           if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyNRNSA]) {
                               return @"5g";
                           } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyNR]) {
                               return @"5g";
                           }
                       }
                       #endif
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [cordova-plugin-network-information] erisu commented on a diff in pull request #130: feat(android, ios): add 5G support

Posted by GitBox <gi...@apache.org>.
erisu commented on code in PR #130:
URL: https://github.com/apache/cordova-plugin-network-information/pull/130#discussion_r995294370


##########
src/android/NetworkManager.java:
##########
@@ -46,17 +54,17 @@ public class NetworkManager extends CordovaPlugin {
 
     public static final String WIFI = "wifi";
     public static final String WIMAX = "wimax";
-    // mobile
+  // mobile

Review Comment:
   ```suggestion
       // mobile
   ```
   Just a nitpick, but can we change the indention level back to 4 spaces?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [cordova-plugin-network-information] ZumelzuR commented on pull request #130: feat(android, ios): add 5G support

Posted by GitBox <gi...@apache.org>.
ZumelzuR commented on PR #130:
URL: https://github.com/apache/cordova-plugin-network-information/pull/130#issuecomment-1320084643

   Can somebody run the test or merge finally this? @erisu @breautek 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [cordova-plugin-network-information] breautek commented on a diff in pull request #130: 5g feature

Posted by GitBox <gi...@apache.org>.
breautek commented on code in PR #130:
URL: https://github.com/apache/cordova-plugin-network-information/pull/130#discussion_r897041316


##########
src/ios/CDVConnection.m:
##########
@@ -82,6 +82,12 @@ - (NSString*)w3cConnectionTypeFor:(CDVReachability*)reachability
                         return @"3g";
                     } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyLTE]) {
                         return @"4g";
+                    } else if (@available(iOS 14.0, *)) {

Review Comment:
   Good catch!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [cordova-plugin-network-information] breautek closed pull request #130: 5g feature

Posted by GitBox <gi...@apache.org>.
breautek closed pull request #130: 5g feature
URL: https://github.com/apache/cordova-plugin-network-information/pull/130


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [cordova-plugin-network-information] ZumelzuR commented on pull request #130: 5g feature

Posted by GitBox <gi...@apache.org>.
ZumelzuR commented on PR #130:
URL: https://github.com/apache/cordova-plugin-network-information/pull/130#issuecomment-1157599750

   Done, I added the fixes at https://github.com/apache/cordova-plugin-network-information/pull/130/commits/b65a78315c6ed5e309fc639a2c02f9069d49505e
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [cordova-plugin-network-information] breautek closed pull request #130: feat(android, ios): add 5G support

Posted by GitBox <gi...@apache.org>.
breautek closed pull request #130: feat(android, ios): add 5G support
URL: https://github.com/apache/cordova-plugin-network-information/pull/130


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [cordova-plugin-network-information] DavidWiesner commented on pull request #130: 5g feature

Posted by GitBox <gi...@apache.org>.
DavidWiesner commented on PR #130:
URL: https://github.com/apache/cordova-plugin-network-information/pull/130#issuecomment-1157771989

   I got an error
   
   network-information/CDVConnection.m:63:94: expected ';' at end of declaration


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [cordova-plugin-network-information] erisu commented on a diff in pull request #130: 5g feature

Posted by GitBox <gi...@apache.org>.
erisu commented on code in PR #130:
URL: https://github.com/apache/cordova-plugin-network-information/pull/130#discussion_r994691719


##########
src/ios/CDVConnection.m:
##########
@@ -60,28 +60,35 @@ - (NSString*)w3cConnectionTypeFor:(CDVReachability*)reachability
             } else {
                 if ([[[UIDevice currentDevice] systemVersion] compare:@"7.0" options:NSNumericSearch] != NSOrderedAscending) {
                     CTTelephonyNetworkInfo *telephonyInfo = [CTTelephonyNetworkInfo new];
-                    if ([telephonyInfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyGPRS]) {
+                    NSString *currentRadioAccessTechnology = radioAccessNameIn(telephonyInfo);
+                    if ([currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyGPRS]) {
                         return @"2g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyEdge]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyEdge]) {
                         return @"2g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyWCDMA]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyWCDMA]) {
                         return @"3g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyHSDPA]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyHSDPA]) {
                         return @"3g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyHSUPA]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyHSUPA]) {
                         return @"3g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyCDMA1x]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyCDMA1x]) {
                         return @"3g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyCDMAEVDORev0]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyCDMAEVDORev0]) {
                         return @"3g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyCDMAEVDORevA]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyCDMAEVDORevA]) {
                         return @"3g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyCDMAEVDORevB]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyCDMAEVDORevB]) {
                         return @"3g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyeHRPD]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyeHRPD]) {
                         return @"3g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyLTE]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyLTE]) {
                         return @"4g";
+                    } else if (@available(iOS 14.1, *)) {
+                        if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyNRNSA]) {
+                            return @"5g";
+                        } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyNR]) {
+                            return @"5g";
+                        }

Review Comment:
   The **iOS 13.x Test** is failing because `CTRadioAccessTechnologyNRNSA` and `CTRadioAccessTechnologyNR` are undeclared identifiers for the version of Xcode that is compiling the iOS 13.x test.
   
   iOS 13.x is using Xcode 11.x while the identifiers were added in iOS 14.1 (Xcode 12.1).
   
   You might want want to test it with something like this.
   ```suggestion
                       } 
                       #if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_14_1 
                       else if (@available(iOS 14.1, *)) {
                           if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyNRNSA]) {
                               return @"5g";
                           } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyNR]) {
                               return @"5g";
                           }
                       }
                       #endif
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [cordova-plugin-network-information] ZumelzuR commented on a diff in pull request #130: feat(android, ios): add 5G support

Posted by GitBox <gi...@apache.org>.
ZumelzuR commented on code in PR #130:
URL: https://github.com/apache/cordova-plugin-network-information/pull/130#discussion_r1055186631


##########
src/ios/CDVConnection.m:
##########
@@ -60,28 +60,39 @@ - (NSString*)w3cConnectionTypeFor:(CDVReachability*)reachability
             } else {
                 if ([[[UIDevice currentDevice] systemVersion] compare:@"7.0" options:NSNumericSearch] != NSOrderedAscending) {
                     CTTelephonyNetworkInfo *telephonyInfo = [CTTelephonyNetworkInfo new];
-                    if ([telephonyInfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyGPRS]) {
+                    NSString *currentRadioAccessTechnology = radioAccessNameIn(telephonyInfo);
+                    if ([currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyGPRS]) {
                         return @"2g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyEdge]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyEdge]) {
                         return @"2g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyWCDMA]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyWCDMA]) {
                         return @"3g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyHSDPA]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyHSDPA]) {
                         return @"3g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyHSUPA]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyHSUPA]) {
                         return @"3g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyCDMA1x]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyCDMA1x]) {
                         return @"3g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyCDMAEVDORev0]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyCDMAEVDORev0]) {
                         return @"3g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyCDMAEVDORevA]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyCDMAEVDORevA]) {
                         return @"3g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyCDMAEVDORevB]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyCDMAEVDORevB]) {
                         return @"3g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyeHRPD]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyeHRPD]) {
                         return @"3g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyLTE]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyLTE]) {
                         return @"4g";
+                    } 
+                    #if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_14_1 
+                    else if (@available(iOS 14.1, *)) {
+                        if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyNRNSA]) {

Review Comment:
   @breautek  this error not make much sense for me, I mean is in a block of code that if the version is iOS14 will try to access.
   
   Also I read this error is related with the xcode 
   
   https://github.com/dcloudio/native-docs/issues/30 
   https://stackoverflow.com/questions/71585983/use-of-undeclared-identifier-ctradioaccesstechnologynr
   
   Any suggestions? I have the last version of xcode and I will try to run it in iOS 13 simulator and check if I can reproduce



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [cordova-plugin-network-information] mdivya-symplr commented on pull request #130: 5g feature

Posted by GitBox <gi...@apache.org>.
mdivya-symplr commented on PR #130:
URL: https://github.com/apache/cordova-plugin-network-information/pull/130#issuecomment-1265333059

   @ZumelzuR I see IOS Test suites are failing for this PR


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [cordova-plugin-network-information] erisu commented on a diff in pull request #130: feat(android, ios): add 5G support

Posted by GitBox <gi...@apache.org>.
erisu commented on code in PR #130:
URL: https://github.com/apache/cordova-plugin-network-information/pull/130#discussion_r995294370


##########
src/android/NetworkManager.java:
##########
@@ -46,17 +54,17 @@ public class NetworkManager extends CordovaPlugin {
 
     public static final String WIFI = "wifi";
     public static final String WIMAX = "wimax";
-    // mobile
+  // mobile

Review Comment:
   ```suggestion
       // mobile
   ```
   Just a nitpick, but can we change the indention level back to 4 spaces?
   
   I prefer a 2-space indention, but Cordova uses a 4-space indention everywhere.



##########
src/android/NetworkManager.java:
##########
@@ -65,11 +73,16 @@ public class NetworkManager extends CordovaPlugin {
     public static final String HSDPA = "hsdpa";
     public static final String ONEXRTT = "1xrtt";
     public static final String EHRPD = "ehrpd";
-    // 4G network types
+  // 4G network types
     public static final String FOUR_G = "4g";
     public static final String LTE = "lte";
     public static final String UMB = "umb";
     public static final String HSPA_PLUS = "hspa+";
+
+  // 5G network types

Review Comment:
   ```suggestion
       // 5G network types
   ```
   
   Same here.



##########
src/android/NetworkManager.java:
##########
@@ -46,17 +54,17 @@ public class NetworkManager extends CordovaPlugin {
 
     public static final String WIFI = "wifi";
     public static final String WIMAX = "wimax";
-    // mobile
+  // mobile
     public static final String MOBILE = "mobile";
 
-    // Android L calls this Cellular, because I have no idea!
+  // Android L calls this Cellular, because I have no idea!

Review Comment:
   ```suggestion
       // Android L calls this Cellular, because I have no idea!
   ```
   
   Same here.



##########
src/android/NetworkManager.java:
##########
@@ -96,15 +115,17 @@ public class NetworkManager extends CordovaPlugin {
      * @param webView The CordovaWebView Cordova is running in.
      */
     public void initialize(CordovaInterface cordova, CordovaWebView webView) {
-        super.initialize(cordova, webView);
-        this.sockMan = (ConnectivityManager) cordova.getActivity().getSystemService(Context.CONNECTIVITY_SERVICE);
-        this.connectionCallbackContext = null;
+    super.initialize(cordova, webView);
+    this.sockMan = (ConnectivityManager) cordova.getActivity().getSystemService(Context.CONNECTIVITY_SERVICE);
+    this.telMan = (TelephonyManager) cordova.getActivity().getSystemService(Context.TELEPHONY_SERVICE);
+    this.telMan.listen( phoneStateListener, LISTEN_SERVICE_STATE);
+    this.connectionCallbackContext = null;
 
-        this.registerConnectivityActionReceiver();
+    this.registerConnectivityActionReceiver();

Review Comment:
   ```suggestion
           this.registerConnectivityActionReceiver();
   ```
   
   Same here



##########
types/index.d.ts:
##########
@@ -57,6 +58,7 @@ declare var Connection: {
     CELL_2G: string;
     CELL_3G: string;
     CELL_4G: string;
+    CELL_5G: string;
     CELL: string;
     NONE: string;
 }

Review Comment:
   ```suggestion
   }
   
   ```
   
   Add new line at end of file.



##########
src/android/NetworkManager.java:
##########
@@ -96,15 +115,17 @@ public class NetworkManager extends CordovaPlugin {
      * @param webView The CordovaWebView Cordova is running in.
      */
     public void initialize(CordovaInterface cordova, CordovaWebView webView) {
-        super.initialize(cordova, webView);
-        this.sockMan = (ConnectivityManager) cordova.getActivity().getSystemService(Context.CONNECTIVITY_SERVICE);
-        this.connectionCallbackContext = null;
+    super.initialize(cordova, webView);
+    this.sockMan = (ConnectivityManager) cordova.getActivity().getSystemService(Context.CONNECTIVITY_SERVICE);
+    this.telMan = (TelephonyManager) cordova.getActivity().getSystemService(Context.TELEPHONY_SERVICE);
+    this.telMan.listen( phoneStateListener, LISTEN_SERVICE_STATE);
+    this.connectionCallbackContext = null;
 
-        this.registerConnectivityActionReceiver();
+    this.registerConnectivityActionReceiver();
     }
 
     /**
-     * Executes the request and returns PluginResult.
+ Executes the request and returns PluginResult.

Review Comment:
   ```suggestion
        * Executes the request and returns PluginResult.
   ```
   
   Revert this change.



##########
src/android/NetworkManager.java:
##########
@@ -270,28 +298,104 @@ private String getType(NetworkInfo info) {
         } else if (type.toLowerCase().equals(TYPE_ETHERNET) || type.toLowerCase().startsWith(TYPE_ETHERNET_SHORT)) {
             return TYPE_ETHERNET;
         } else if (type.equals(MOBILE) || type.equals(CELLULAR)) {
-            type = info.getSubtypeName().toLowerCase(Locale.US);
-            if (type.equals(GSM) ||
-                    type.equals(GPRS) ||
-                    type.equals(EDGE) ||
-                    type.equals(TWO_G)) {
-                return TYPE_2G;
-            } else if (type.startsWith(CDMA) ||
-                    type.equals(UMTS) ||
-                    type.equals(ONEXRTT) ||
-                    type.equals(EHRPD) ||
-                    type.equals(HSUPA) ||
-                    type.equals(HSDPA) ||
-                    type.equals(HSPA) ||
-                    type.equals(THREE_G)) {
-                return TYPE_3G;
-            } else if (type.equals(LTE) ||
-                    type.equals(UMB) ||
-                    type.equals(HSPA_PLUS) ||
-                    type.equals(FOUR_G)) {
-                return TYPE_4G;
+            return getMobileType(info);
+        }
+        return TYPE_UNKNOWN;
+    }
+
+    /**
+     * Determine the subtype of mobile connection
+     *
+     * @param info the network info so we can determine connection type.
+     * @return the type of mobile network we are on
+     */
+    private String getMobileType(NetworkInfo info){
+        int subTypeId = info.getSubtype();
+        String subTypeName = info.getSubtypeName().toLowerCase(Locale.US);
+        if(is2G(subTypeId, subTypeName)){
+            return TYPE_2G;
+        } else if(is3G(subTypeId, subTypeName)) {
+            return TYPE_3G;
+        } else if(is4G(subTypeId, subTypeName)) {
+            if(isNrAvailable){ // if is LTE network could be 5g if NR is available
+                return TYPE_5G;
             }
+            return TYPE_4G;
+        } else if(is5G(subTypeId, subTypeName)) {
+            return TYPE_5G;
         }
         return TYPE_UNKNOWN;
     }
+
+    private boolean is2G(int type, String name){
+        return  type == TelephonyManager.NETWORK_TYPE_GPRS ||
+                type == TelephonyManager.NETWORK_TYPE_EDGE ||
+                type == TelephonyManager.NETWORK_TYPE_CDMA ||
+                type == TelephonyManager.NETWORK_TYPE_1xRTT ||
+                type == TelephonyManager.NETWORK_TYPE_IDEN ||    // api< 8: replace by 11
+                type == TelephonyManager.NETWORK_TYPE_GSM ||     // api<25: replace by 16
+                name.equals(GSM) ||
+                name.equals(GPRS) ||
+                name.equals(EDGE) ||
+                name.equals(TWO_G);
+    }
+
+    private boolean is3G(int type, String name){
+        return  type ==  TelephonyManager.NETWORK_TYPE_UMTS ||
+                type ==  TelephonyManager.NETWORK_TYPE_EVDO_0 ||
+                type ==  TelephonyManager.NETWORK_TYPE_EVDO_A ||
+                type ==  TelephonyManager.NETWORK_TYPE_HSDPA ||
+                type ==  TelephonyManager.NETWORK_TYPE_HSUPA ||
+                type ==  TelephonyManager.NETWORK_TYPE_HSPA ||
+                type ==  TelephonyManager.NETWORK_TYPE_EVDO_B ||   // api< 9: replace by 12
+                type ==  TelephonyManager.NETWORK_TYPE_EHRPD ||    // api<11: replace by 14
+                type ==  TelephonyManager.NETWORK_TYPE_HSPAP ||    // api<13: replace by 15
+                type ==  TelephonyManager.NETWORK_TYPE_TD_SCDMA || // api<25: replace by 17
+                name.startsWith(CDMA) ||
+                name.equals(UMTS) ||
+                name.equals(ONEXRTT) ||
+                name.equals(EHRPD) ||
+                name.equals(HSUPA) ||
+                name.equals(HSDPA) ||
+                name.equals(HSPA) ||
+                name.equals(THREE_G);
+    }
+
+    private boolean is4G(int type, String name){
+

Review Comment:
   ```suggestion
   ```
   
   Nitpick: No need of new line here.



##########
src/android/NetworkManager.java:
##########
@@ -96,15 +115,17 @@ public class NetworkManager extends CordovaPlugin {
      * @param webView The CordovaWebView Cordova is running in.
      */
     public void initialize(CordovaInterface cordova, CordovaWebView webView) {
-        super.initialize(cordova, webView);
-        this.sockMan = (ConnectivityManager) cordova.getActivity().getSystemService(Context.CONNECTIVITY_SERVICE);
-        this.connectionCallbackContext = null;
+    super.initialize(cordova, webView);
+    this.sockMan = (ConnectivityManager) cordova.getActivity().getSystemService(Context.CONNECTIVITY_SERVICE);
+    this.telMan = (TelephonyManager) cordova.getActivity().getSystemService(Context.TELEPHONY_SERVICE);
+    this.telMan.listen( phoneStateListener, LISTEN_SERVICE_STATE);
+    this.connectionCallbackContext = null;

Review Comment:
   ```suggestion
           super.initialize(cordova, webView);
           this.sockMan = (ConnectivityManager) cordova.getActivity().getSystemService(Context.CONNECTIVITY_SERVICE);
           this.telMan = (TelephonyManager) cordova.getActivity().getSystemService(Context.TELEPHONY_SERVICE);
           this.telMan.listen( phoneStateListener, LISTEN_SERVICE_STATE);
           this.connectionCallbackContext = null;
   ```
   
   Same here. It seems to not be indented at all within the method block.



##########
src/android/NetworkManager.java:
##########
@@ -270,28 +298,104 @@ private String getType(NetworkInfo info) {
         } else if (type.toLowerCase().equals(TYPE_ETHERNET) || type.toLowerCase().startsWith(TYPE_ETHERNET_SHORT)) {
             return TYPE_ETHERNET;
         } else if (type.equals(MOBILE) || type.equals(CELLULAR)) {
-            type = info.getSubtypeName().toLowerCase(Locale.US);
-            if (type.equals(GSM) ||
-                    type.equals(GPRS) ||
-                    type.equals(EDGE) ||
-                    type.equals(TWO_G)) {
-                return TYPE_2G;
-            } else if (type.startsWith(CDMA) ||
-                    type.equals(UMTS) ||
-                    type.equals(ONEXRTT) ||
-                    type.equals(EHRPD) ||
-                    type.equals(HSUPA) ||
-                    type.equals(HSDPA) ||
-                    type.equals(HSPA) ||
-                    type.equals(THREE_G)) {
-                return TYPE_3G;
-            } else if (type.equals(LTE) ||
-                    type.equals(UMB) ||
-                    type.equals(HSPA_PLUS) ||
-                    type.equals(FOUR_G)) {
-                return TYPE_4G;
+            return getMobileType(info);
+        }
+        return TYPE_UNKNOWN;
+    }
+
+    /**
+     * Determine the subtype of mobile connection
+     *
+     * @param info the network info so we can determine connection type.
+     * @return the type of mobile network we are on
+     */
+    private String getMobileType(NetworkInfo info){
+        int subTypeId = info.getSubtype();
+        String subTypeName = info.getSubtypeName().toLowerCase(Locale.US);
+        if(is2G(subTypeId, subTypeName)){
+            return TYPE_2G;
+        } else if(is3G(subTypeId, subTypeName)) {
+            return TYPE_3G;
+        } else if(is4G(subTypeId, subTypeName)) {
+            if(isNrAvailable){ // if is LTE network could be 5g if NR is available
+                return TYPE_5G;
             }
+            return TYPE_4G;
+        } else if(is5G(subTypeId, subTypeName)) {
+            return TYPE_5G;
         }
         return TYPE_UNKNOWN;
     }
+
+    private boolean is2G(int type, String name){
+        return  type == TelephonyManager.NETWORK_TYPE_GPRS ||
+                type == TelephonyManager.NETWORK_TYPE_EDGE ||
+                type == TelephonyManager.NETWORK_TYPE_CDMA ||
+                type == TelephonyManager.NETWORK_TYPE_1xRTT ||
+                type == TelephonyManager.NETWORK_TYPE_IDEN ||    // api< 8: replace by 11
+                type == TelephonyManager.NETWORK_TYPE_GSM ||     // api<25: replace by 16
+                name.equals(GSM) ||
+                name.equals(GPRS) ||
+                name.equals(EDGE) ||
+                name.equals(TWO_G);
+    }
+
+    private boolean is3G(int type, String name){
+        return  type ==  TelephonyManager.NETWORK_TYPE_UMTS ||
+                type ==  TelephonyManager.NETWORK_TYPE_EVDO_0 ||
+                type ==  TelephonyManager.NETWORK_TYPE_EVDO_A ||
+                type ==  TelephonyManager.NETWORK_TYPE_HSDPA ||
+                type ==  TelephonyManager.NETWORK_TYPE_HSUPA ||
+                type ==  TelephonyManager.NETWORK_TYPE_HSPA ||
+                type ==  TelephonyManager.NETWORK_TYPE_EVDO_B ||   // api< 9: replace by 12
+                type ==  TelephonyManager.NETWORK_TYPE_EHRPD ||    // api<11: replace by 14
+                type ==  TelephonyManager.NETWORK_TYPE_HSPAP ||    // api<13: replace by 15
+                type ==  TelephonyManager.NETWORK_TYPE_TD_SCDMA || // api<25: replace by 17
+                name.startsWith(CDMA) ||
+                name.equals(UMTS) ||
+                name.equals(ONEXRTT) ||
+                name.equals(EHRPD) ||
+                name.equals(HSUPA) ||
+                name.equals(HSDPA) ||
+                name.equals(HSPA) ||
+                name.equals(THREE_G);
+    }
+
+    private boolean is4G(int type, String name){
+
+        return  type == TelephonyManager.NETWORK_TYPE_LTE && name.equals(FOUR_G) ||     // api<11: replace by 13
+                type == TelephonyManager.NETWORK_TYPE_IWLAN ||  // api<25: replace by 18
+                type == NETWORK_TYPE_LTE_CA || // LTE_CA
+                name.equals(LTE) ||
+                name.equals(UMB) ||
+                name.equals(HSPA_PLUS) ||
+                name.equals(FOUR_G);
+    }
+
+    private boolean is5G(int type, String name){
+

Review Comment:
   ```suggestion
   ```
   
   Nitpick: No need of new line here.



##########
src/android/NetworkManager.java:
##########
@@ -65,11 +73,16 @@ public class NetworkManager extends CordovaPlugin {
     public static final String HSDPA = "hsdpa";
     public static final String ONEXRTT = "1xrtt";
     public static final String EHRPD = "ehrpd";
-    // 4G network types
+  // 4G network types

Review Comment:
   ```suggestion
       // 4G network types
   ```
   
   Same here.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [cordova-plugin-network-information] ZumelzuR commented on pull request #130: 5g feature

Posted by GitBox <gi...@apache.org>.
ZumelzuR commented on PR #130:
URL: https://github.com/apache/cordova-plugin-network-information/pull/130#issuecomment-1091836786

   Sorry was impossible to me to do this changes before. I update all as you requested and tested in my local. If you have more feedback or changes to me add let me know


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [cordova-plugin-network-information] breautek commented on a diff in pull request #130: feat(android, ios): add 5G support

Posted by GitBox <gi...@apache.org>.
breautek commented on code in PR #130:
URL: https://github.com/apache/cordova-plugin-network-information/pull/130#discussion_r1051142396


##########
src/ios/CDVConnection.m:
##########
@@ -60,28 +60,39 @@ - (NSString*)w3cConnectionTypeFor:(CDVReachability*)reachability
             } else {
                 if ([[[UIDevice currentDevice] systemVersion] compare:@"7.0" options:NSNumericSearch] != NSOrderedAscending) {
                     CTTelephonyNetworkInfo *telephonyInfo = [CTTelephonyNetworkInfo new];
-                    if ([telephonyInfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyGPRS]) {
+                    NSString *currentRadioAccessTechnology = radioAccessNameIn(telephonyInfo);
+                    if ([currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyGPRS]) {
                         return @"2g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyEdge]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyEdge]) {
                         return @"2g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyWCDMA]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyWCDMA]) {
                         return @"3g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyHSDPA]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyHSDPA]) {
                         return @"3g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyHSUPA]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyHSUPA]) {
                         return @"3g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyCDMA1x]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyCDMA1x]) {
                         return @"3g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyCDMAEVDORev0]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyCDMAEVDORev0]) {
                         return @"3g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyCDMAEVDORevA]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyCDMAEVDORevA]) {
                         return @"3g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyCDMAEVDORevB]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyCDMAEVDORevB]) {
                         return @"3g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyeHRPD]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyeHRPD]) {
                         return @"3g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyLTE]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyLTE]) {
                         return @"4g";
+                    } 
+                    #if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_14_1 
+                    else if (@available(iOS 14.1, *)) {
+                        if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyNRNSA]) {
+                            return @"5g";
+                        } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyNR]) {
+                            return @"5g";
+                        }
+                    }
+                    #endif
                     }

Review Comment:
   I think this is also causing a syntax error...
   
   ```
   var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/tmp-3401-5V69QdTKGZQj/platforms/ios/HelloCordova/Plugins/cordova-plugin-network-information/CDVConnection.m:113:1: error: extraneous closing brace ('}')
   }
   ```



##########
src/ios/CDVConnection.m:
##########
@@ -60,28 +60,39 @@ - (NSString*)w3cConnectionTypeFor:(CDVReachability*)reachability
             } else {
                 if ([[[UIDevice currentDevice] systemVersion] compare:@"7.0" options:NSNumericSearch] != NSOrderedAscending) {
                     CTTelephonyNetworkInfo *telephonyInfo = [CTTelephonyNetworkInfo new];
-                    if ([telephonyInfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyGPRS]) {
+                    NSString *currentRadioAccessTechnology = radioAccessNameIn(telephonyInfo);
+                    if ([currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyGPRS]) {
                         return @"2g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyEdge]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyEdge]) {
                         return @"2g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyWCDMA]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyWCDMA]) {
                         return @"3g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyHSDPA]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyHSDPA]) {
                         return @"3g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyHSUPA]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyHSUPA]) {
                         return @"3g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyCDMA1x]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyCDMA1x]) {
                         return @"3g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyCDMAEVDORev0]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyCDMAEVDORev0]) {
                         return @"3g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyCDMAEVDORevA]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyCDMAEVDORevA]) {
                         return @"3g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyCDMAEVDORevB]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyCDMAEVDORevB]) {
                         return @"3g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyeHRPD]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyeHRPD]) {
                         return @"3g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyLTE]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyLTE]) {
                         return @"4g";
+                    } 
+                    #if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_14_1 
+                    else if (@available(iOS 14.1, *)) {
+                        if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyNRNSA]) {

Review Comment:
   the preprocessor macro doesn't appear to be working as intended here cause iOS 13 tests is failing on this line due to `CTRadioAccessTechnologyNRNSA` not being available.
   
   ```
   /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/tmp-3401-5V69QdTKGZQj/platforms/ios/HelloCordova/Plugins/cordova-plugin-network-information/CDVConnection.m:89:76: error: use of undeclared identifier 'CTRadioAccessTechnologyNRNSA'
                           if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyNRNSA]) {
                                                                              ^
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [cordova-plugin-network-information] breautek commented on pull request #130: feat(android, ios): add 5G support

Posted by GitBox <gi...@apache.org>.
breautek commented on PR #130:
URL: https://github.com/apache/cordova-plugin-network-information/pull/130#issuecomment-1355574052

   closed/re-opened the PR as the test results expired and wasn't available. Assuming that the tests passes I'll do one last row call and I'll merge if there are no objections in the next ~24 hours.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [cordova-plugin-network-information] ZumelzuR commented on pull request #130: 5g feature

Posted by GitBox <gi...@apache.org>.
ZumelzuR commented on PR #130:
URL: https://github.com/apache/cordova-plugin-network-information/pull/130#issuecomment-1122233204

   what about this?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [cordova-plugin-network-information] ZumelzuR commented on pull request #130: feat(android, ios): add 5G support

Posted by GitBox <gi...@apache.org>.
ZumelzuR commented on PR #130:
URL: https://github.com/apache/cordova-plugin-network-information/pull/130#issuecomment-1302527973

   some update on this?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [cordova-plugin-network-information] ZumelzuR commented on pull request #130: feat(android, ios): add 5G support

Posted by GitBox <gi...@apache.org>.
ZumelzuR commented on PR #130:
URL: https://github.com/apache/cordova-plugin-network-information/pull/130#issuecomment-1290929913

   I review the commits and add the changes


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [cordova-plugin-network-information] ZumelzuR commented on a diff in pull request #130: feat(android, ios): add 5G support

Posted by GitBox <gi...@apache.org>.
ZumelzuR commented on code in PR #130:
URL: https://github.com/apache/cordova-plugin-network-information/pull/130#discussion_r1055186631


##########
src/ios/CDVConnection.m:
##########
@@ -60,28 +60,39 @@ - (NSString*)w3cConnectionTypeFor:(CDVReachability*)reachability
             } else {
                 if ([[[UIDevice currentDevice] systemVersion] compare:@"7.0" options:NSNumericSearch] != NSOrderedAscending) {
                     CTTelephonyNetworkInfo *telephonyInfo = [CTTelephonyNetworkInfo new];
-                    if ([telephonyInfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyGPRS]) {
+                    NSString *currentRadioAccessTechnology = radioAccessNameIn(telephonyInfo);
+                    if ([currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyGPRS]) {
                         return @"2g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyEdge]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyEdge]) {
                         return @"2g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyWCDMA]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyWCDMA]) {
                         return @"3g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyHSDPA]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyHSDPA]) {
                         return @"3g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyHSUPA]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyHSUPA]) {
                         return @"3g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyCDMA1x]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyCDMA1x]) {
                         return @"3g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyCDMAEVDORev0]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyCDMAEVDORev0]) {
                         return @"3g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyCDMAEVDORevA]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyCDMAEVDORevA]) {
                         return @"3g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyCDMAEVDORevB]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyCDMAEVDORevB]) {
                         return @"3g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyeHRPD]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyeHRPD]) {
                         return @"3g";
-                    } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyLTE]) {
+                    } else if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyLTE]) {
                         return @"4g";
+                    } 
+                    #if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_14_1 
+                    else if (@available(iOS 14.1, *)) {
+                        if ([currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyNRNSA]) {

Review Comment:
   this error not make much sense for me, I mean is in a block of code that if the version is iOS14 will try to access.
   
   Also I read this error is related with the xcode 
   
   https://github.com/dcloudio/native-docs/issues/30 
   https://stackoverflow.com/questions/71585983/use-of-undeclared-identifier-ctradioaccesstechnologynr
   
   Any suggestions? I have the last version of xcode and I will try to run it in iOS 13 simulator and check if I can reproduce



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [cordova-plugin-network-information] DavidWiesner commented on a diff in pull request #130: 5g feature

Posted by GitBox <gi...@apache.org>.
DavidWiesner commented on code in PR #130:
URL: https://github.com/apache/cordova-plugin-network-information/pull/130#discussion_r896513615


##########
src/ios/CDVConnection.m:
##########
@@ -82,6 +82,12 @@ - (NSString*)w3cConnectionTypeFor:(CDVReachability*)reachability
                         return @"3g";
                     } else if ([telephonyInfo.currentRadioAccessTechnology  isEqualToString:CTRadioAccessTechnologyLTE]) {
                         return @"4g";
+                    } else if (@available(iOS 14.0, *)) {

Review Comment:
   There was an issue in the apple docs. `CTRadioAccessTechnologyNRNSA` and `CTRadioAccessTechnologyNR` are available in the minor release [14.1](https://developer.apple.com/documentation/coretelephony/ctradioaccesstechnologynrnsa)
   ```suggestion
                       } else if (@available(iOS 14.1, *)) {
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [cordova-plugin-network-information] ZumelzuR commented on pull request #130: 5g feature

Posted by GitBox <gi...@apache.org>.
ZumelzuR commented on PR #130:
URL: https://github.com/apache/cordova-plugin-network-information/pull/130#issuecomment-1158084704

   > I got an error
   > 
   > network-information/CDVConnection.m:63:94: expected ';' at end of declaration
   
   Sorry I forgot this, I added in the plugins folder but not here, I already add the fix commit. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [cordova-plugin-network-information] DavidWiesner commented on pull request #130: 5g feature

Posted by GitBox <gi...@apache.org>.
DavidWiesner commented on PR #130:
URL: https://github.com/apache/cordova-plugin-network-information/pull/130#issuecomment-1155976726

   @ZumelzuR On my iPhone 13 Pro `networkInfo.currentRadioAccessTechnology` is always nil. Strange enough another phone (with the same os version) this pointer is not nil. I found `networkInfo.currentRadioAccessTechnology` is deprecated and can be nil on ios >= 14.2. I`ve found this fix https://github.com/Tencent/Hippy/pull/1597/files. May you can try this and add this to your PR.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [cordova-plugin-network-information] ZumelzuR commented on pull request #130: 5g feature

Posted by GitBox <gi...@apache.org>.
ZumelzuR commented on PR #130:
URL: https://github.com/apache/cordova-plugin-network-information/pull/130#issuecomment-1092618860

   You are right. Sorry I didn't realized about the changes on the package-lock.json. I will do the revert now


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [cordova-plugin-network-information] ZumelzuR closed pull request #130: 5g feature

Posted by GitBox <gi...@apache.org>.
ZumelzuR closed pull request #130: 5g feature
URL: https://github.com/apache/cordova-plugin-network-information/pull/130


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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