Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] Add 5g cellular type #436

Merged
merged 6 commits into from Nov 13, 2021

Conversation

luisnaranjo733
Copy link
Contributor

Overview

Adds support for the 5G cellular type on Android and iOS. Intentionally missing Windows changes because the native platform does not have a 5G type yet according to the documentation that @matt-oakes shared in issue #153

JS changes

  • Add the 5G enum type
  • Add unit tests

Android changes

  • Bump compile sdk version to 29 and bump platform tools version to latest 29 to match (required to get access to new enum)

Test Plan

Blocked on testing. Looking for help from others testing these changes.
I ran into multiple issues building the app on iOS and Android.

For now, I'm just going to open a PR and see if the CI pipeline can validate my changes, because I can't build this project even from the master branch.

On iOS, I get the following build error when building the example iOS app.

luis@MacBook-Pro react-native-netinfo % yarn test:detox:ios:build:debug
yarn run v1.22.10
$ detox build -c ios.sim.debug
detox[30363] INFO:  [build.js] export RCT_NO_LAUNCH_PACKAGER=true && xcodebuild -project example/ios/NetInfoExample.xcodeproj -destination 'platform=iOS Simulator,name=iPhone 11' -scheme NetInfoExample -parallelizeTargets -configuration Debug -derivedDataPath example/ios/build  -UseModernBuildSystem=YES | xcpretty -k

❌  error: /Users/luis/code/react-native-netinfo/example/ios/Pods/Target Support Files/Pods-NetInfoExample/Pods-NetInfoExample.debug.xcconfig: unable to open file (in target "NetInfoExample" in project "NetInfoExample") (in target 'NetInfoExample' from project 'NetInfoExample')

On Android, Android Studio fails to sync gradle due to some missing project files. This prevents the build from working in Android Studio.

Could not read script '/Users/luis/code/react-native-netinfo/example/node_modules/@react-native-community/cli-platform-android/native_modules.gradle' as it does not exist.

Trying to build from the command line (using gradlew) yields a cryptic build error (Could not initialize class org.codehaus.groovy.runtime.InvokerHelper) that I'm assuming is related to the root cause (missing native_modules.gradle)

Open questions

  • Need to test this on Android API 28 (before this enum was introduced) as well as 29 (first API where this was introduced) to ensure these changes are backwards compatible.
  • On iOS, there are two 5G related enum values (CTRadioAccessTechnologyNRNSA
    and CTRadioAccessTechnologyNR
    ). It's not clear if both are desired or not, so I just included both but to be honest I don't totally understand the difference and if that's the right decision or not.

@MateusAndrade
Copy link

There is any update about this? 👀

@mikehardy
Copy link
Contributor

@MateusAndrade I suspect @matt-oakes is maybe not even working on react-native items anymore. If we're not careful we'll end up maintainers here ;-)

@luisnaranjo733
Copy link
Contributor Author

This PR is blocked on two things

  1. Waiting on code review from maintainers - ping @matt-oakes
  2. The master branch testing apps seem to be in a broken state, which makes testing difficult (at least when I opened this PR). I did some limited manual testing on Android, but none on iOS. Would welcome contributions from others in testing these changes out. In practice, they should be fine, since they are so small, but I think it's a good idea to maintain a high quality bar in terms of testing.

I'm still here and would be happy to keep engaging with this PR and helping out.

@mikehardy
Copy link
Contributor

mikehardy commented Oct 18, 2021

I have maintainer ability now and can merge things - semantic release can then do a look.
So this is waiting on review and the example app.

If someone wanted to take direct action to move this forward, unblocking the example app is the thing, this comment is the current status there:

#500 (comment)

Specifically what I want to do is take the result of building react-native-netinfo from that PR (yarn pack or similar) and use that locally in a sample app from a npx react-native init --version 0.60.6 to make sure it works

Then that merges, and we have an up to date example, then this should go through

Copy link
Contributor

@mikehardy mikehardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, I can merge things now, and the example is updated now.
Going to see about merging and re-pushing to the branch so it forces CI to run again, but expected result is merge+release

Fantastic!

@mikehardy mikehardy added the pending merge A PR that will be merged shortly, waiting for CI or final comment label Nov 13, 2021
@mikehardy mikehardy merged commit 6ba68e9 into react-native-netinfo:master Nov 13, 2021
github-actions bot pushed a commit that referenced this pull request Nov 13, 2021
# [6.2.0](v6.1.1...v6.2.0) (2021-11-13)

### Features

* Add 5g cellular type ([#436](#436)) ([6ba68e9](6ba68e9))
@matt-oakes
Copy link
Collaborator

🎉 This PR is included in version 6.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@mikehardy mikehardy removed the pending merge A PR that will be merged shortly, waiting for CI or final comment label Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants