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

Seems like NetInfo.isConnected.fetch() bug in iOS has been resolved in RN 0.55.x #107

Closed
adam-s opened this issue Jun 21, 2018 · 11 comments
Closed
Assignees

Comments

@adam-s
Copy link

adam-s commented Jun 21, 2018

On the other hand it seems that the work around for the bug (facebook/react-native#8615) using the attached listener now waits for connection event to happen before broadcasting. So the function is run but doesn't resolve. It waits for an event to happen then resolves.

Because of this, the checkInternetConnection() function doesn't work in RN 0.55.x for iOS.

@msardi23
Copy link

msardi23 commented Jun 28, 2018

So to confirm is this library currently broken on iOS?

This is my first time using it and have been pulling my hair out all day trying to get this going via the simulator and a device. Then I tested on an Android device / simulator and everything was working as expected. Are there any work arounds to get this going on iOS?

Update: The stack overflow answer for this post is working for me (i.e. in terms of testing connectivity state and subsequent changes to that state).
https://stackoverflow.com/questions/43198978/how-to-check-net-info-in-react-native-ios

@acomito
Copy link

acomito commented Jun 30, 2018

I'm always getting connected = false...

Environment:
  OS: macOS Sierra 10.12.6
  Node: 9.7.1
  Yarn: 1.5.1
  npm: 5.6.0
  Watchman: 4.9.0
  Xcode: Xcode 9.2 Build version 9C40b
  Android Studio: 3.1 AI-173.4819257

Packages: (wanted => installed)
  react: 16.3.1 => 16.3.1
  react-native: 0.55.4 => 0.55.4
"react-native-offline": "^3.10.0",

was this not resolved in 0.55.4?

@MaxInMoon
Copy link

anyone did find a solution to checkInternetConnection on iOS with RN 0.55.x?
thank you

@chetankotkar
Copy link

I am having same problem checkInternetConnection always return false on IOS .

Any progress on this ??

am using

"react-native": "^0.55.4",
"react-native-offline": "^3.11.2"

@maxammann
Copy link

This has been resolved probably by this commit: facebook/react-native@36199d3

@SudoPlz
Copy link

SudoPlz commented Sep 19, 2018

Resolved or not, here's a module I made to make sure we never see that issue again:
https://github.com/SudoPlz/react-native-connectivity-tracker

@IssueHuntBot
Copy link

@BoostIO funded this issue with $10. Visit this issue on Issuehunt

@IssueHuntBot
Copy link

@issuehuntfest has funded $90.00 to this issue. See it on IssueHunt

@rgommezz rgommezz self-assigned this Dec 31, 2018
rgommezz added a commit that referenced this issue Dec 31, 2018
@IssueHuntBot
Copy link

@rgommezz has submitted a pull request. See it on IssueHunt

@rgommezz
Copy link
Owner

rgommezz commented Jan 1, 2019

I've tested the new major version 4.0.0 with RN 0.55.x and 0.57.x and verified that checkInternetConnection() works correctly.

However, I've noticed that the offline behaviour on iOS simulators is not reliable. I've updated this section on the docs to reflect that.

Could you please give it a try to v.4.0.0 and let me know? In case you are coming from v3, follow the release notes to upgrade.

Thanks!

@IssueHuntBot
Copy link

@rgommezz has rewarded $70.00 to @rgommezz. See it on IssueHunt

  • 💰 Total deposit: $100.00
  • 🎉 Repository reward(20%): $20.00
  • 🔧 Service fee(10%): $10.00

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

No branches or pull requests

9 participants