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: fetch(interface) [Android & iOS] #256

Merged
merged 30 commits into from
Dec 29, 2019
Merged

feat: fetch(interface) [Android & iOS] #256

merged 30 commits into from
Dec 29, 2019

Conversation

Rapsssito
Copy link
Contributor

@Rapsssito Rapsssito commented Nov 26, 2019

Overview

Nowadays, most devices can handle multiple connections via different interfaces at the same time. This library automatically gets the current active connection given by the OS. However, there could be other connections going into the device.
With this feature, we maintain the current standard NetInfo.fetch() but adding the possibility to look for the NetInfoState of a specific network interface.

Implementation

NetInfo.fetch() // Returns the usual NetInfoState of the default current network
NetInfo.fetch('wifi') // Returns the WiFi interface NetInfoState
NetInfo.fetch('ethernet') // Returns the ethernet interface NetInfoState
NetInfo.fetch('cellular') // Returns the cellular interface NetInfoState
...

Compatibility

  • iOS
  • Android

Windows is not compatible. However, I could not test if my changes broke something there. Windows testing is necessary.

Related Issues

Fixes #211
Fixes #51
Fixes #52
Fixes #208
react-native-device-info/react-native-device-info#635

@Rapsssito Rapsssito changed the base branch from matt-oakes/configuration to master December 8, 2019 13:57
@Rapsssito Rapsssito changed the base branch from master to matt-oakes/configuration December 8, 2019 14:00
@matt-oakes matt-oakes changed the base branch from matt-oakes/configuration to master December 29, 2019 15:17
@matt-oakes
Copy link
Collaborator

Thanks for submitting this. Sorry it's taken so long to get back to you on it.

Now that the configuration change PR has been merged in, can you rebase your changes on the master branch so I can review it?

@Rapsssito
Copy link
Contributor Author

@matt-oakes feel free to review it whenever you can.

Copy link
Collaborator

@matt-oakes matt-oakes left a comment

Choose a reason for hiding this comment

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

LGTM. I've made a few style changes to the native code to make them more idiomatic and fixed a small merge error on Android. Merging when the tests pass.

@Rapsssito Would you be interested in helping out with maintaining the library?

@matt-oakes matt-oakes merged commit 05e5fb7 into react-native-netinfo:master Dec 29, 2019
react-native-community-bot pushed a commit that referenced this pull request Dec 29, 2019
# [5.2.0](v5.1.0...v5.2.0) (2019-12-29)

### Features

* Allow fetching details for a specific network interface ([#256](#256) by @Rapsssito) ([05e5fb7](05e5fb7))
@react-native-community-bot
Copy link
Collaborator

🎉 This PR is included in version 5.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@Rapsssito
Copy link
Contributor Author

LGTM. I've made a few style changes to the native code to make them more idiomatic and fixed a small merge error on Android. Merging when the tests pass.

@Rapsssito Would you be interested in helping out with maintaining the library?

@matt-oakes, of course! However, I have zero experience with this types of libraries. I won't be taking part in big changes or issues until I feel confident.

@Rapsssito
Copy link
Contributor Author

LGTM. I've made a few style changes to the native code to make them more idiomatic and fixed a small merge error on Android. Merging when the tests pass.

@Rapsssito Would you be interested in helping out with maintaining the library?

@matt-oakes, I'm sorry to bother you again, is the offer still standing? I have not received news since the message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants