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 parameter useNativeReachability to optionally choose non-native reachability test #609

Merged
merged 4 commits into from Jun 24, 2022

Conversation

andrewssun1
Copy link
Contributor

Overview

While using the API, the reachability checks for some Android devices, namely Amazon Kindle Fires, weren't entirely reliable. Upon testing a case where I manually pulled the plug on the internet, the isInternetReachable would still return true for minutes without an update. The non-native implementation for reachability checks for iOS works very well, so I'm proposing a solution where the user can specify a param to utilize the custom reachability checks to bypass this issue (or if for whatever other reason, they want to specify custom reachability parameters).

Test Plan

  • Ran yarn start:android and built to Amazon Fire Kindle. Accurately reported Network changes
    image
  • Tests passed:
    image

@andrewssun1
Copy link
Contributor Author

Also cc @mikehardy

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 seems reasonable to me - I can see the default is to behave exactly as before, but now if you like you can override it. Appears really well done

I just approved the CI runs so it will chew on it

@mikehardy mikehardy changed the title Add Parameter to override Native Reachability feat: add parameter useNativeReachability to optionally choose non-native reachability test Jun 24, 2022
@mikehardy mikehardy merged commit 9b02cac into react-native-netinfo:master Jun 24, 2022
@mikehardy
Copy link
Contributor

nicely done - thanks!

github-actions bot pushed a commit that referenced this pull request Jun 24, 2022
# [9.1.0](v9.0.0...v9.1.0) (2022-06-24)

### Features

* add parameter useNativeReachability to optionally choose non-native reachability test ([#609](#609)) ([9b02cac](9b02cac))
@matt-oakes
Copy link
Collaborator

🎉 This PR is included in version 9.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

3 participants