cordova-plugin-network-information
cordova-plugin-network-information copied to clipboard
feat(android, ios): add 5G support
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)
- [x ] I've updated the documentation if necessary
How do we get pull requests to get merged in master branch?
Any news about when to release this fix
Thank, these days are a little problematic for me but I will check and resolve all as soon as possible
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
You are right. Sorry I didn't realized about the changes on the package-lock.json. I will do the revert now
what about this?
@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):
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;
}
@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 foundnetworkInfo.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):
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.
Done, I added the fixes at https://github.com/apache/cordova-plugin-network-information/pull/130/commits/b65a78315c6ed5e309fc639a2c02f9069d49505e
I got an error
network-information/CDVConnection.m:63:94: expected ';' at end of declaration
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.
@ZumelzuR I see IOS Test suites are failing for this PR
For fix this I should try to simulate a 5g connection in a ios12 device and check if is working?
@breautek I review the commits and add the changes of @erisu
thanks
some update on this?
Can somebody run the test or merge finally this? @erisu @breautek
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.