question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NetInfo event doesn't fire up | IOS 14.0.1 | Real device

See original GitHub issue

Environment

Expo CLI 3.27.14 environment info: System: OS: macOS 10.15.7 Shell: 3.2.57 - /bin/bash Binaries: Node: 14.3.0 - /usr/local/bin/node npm: 6.14.8 - /usr/local/bin/npm SDKs: iOS SDK: Platforms: iOS 13.5, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2 IDEs: Android Studio: 4.0 AI-193.6911.18.40.6514223 Xcode: 11.5/11E608c - /usr/bin/xcodebuild npmPackages: expo: ^38.0.0 => 38.0.8 react: 16.11.0 => 16.11.0 react-native: https://github.com/expo/react-native/archive/sdk-38.0.0.tar.gz => 0.62.2 react-navigation: ^4.3.9 => 4.4.0 npmGlobalPackages: expo-cli: 3.27.14 Expo Workflow: managed

Platforms

IOS - real device

Versions

  • iOS: 14.0.1
  • react-native-netinfo: 5.9.2
  • react-native: 0.62.2
  • react: 16.11.0

Description

I’m using in the exact same way documented in the library. I have added a simple event handler to check if there is an internet connection. If there isn’t, display an appropriate message on the top of the screen and when it’s back hiding this message.

For android, this method working as expected.

Reproducible Demo

      this.netSubscription = NetInfo.addEventListener(state => {
      util.log('Is connected?', state.isConnected, "Is reachable", state.isInternetReachable, 'Connection type', state.type);

      if (state.isConnected) {
        hideMessage();
      }
      else {
        displayCustomMessage({
          message: "No internet connection",
        });
      }
    });

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:12
  • Comments:14 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
waqaramjadcommented, Sep 15, 2021

@mikehardy latest PR resolved my issue , actually I had some different version

0reactions
mikehardycommented, Sep 15, 2021

@waqaramjad without any context (like, exact versions you are on etc) or a PR you make based on your inspection of the code, your comment unfortunately does not advance the conversation

Read more comments on GitHub >

github_iconTop Results From Across the Web

Xcode | Apple Developer Forums
I am running XCode 14.0.1 on mac ios 12.6. When I try to run any app in any simulator I get and alert:...
Read more >
React Native - NetInfo.addEventListener not triggering when ...
There is a known issue with iOS simulators not reconnecting (under troubleshooting) so if you are testing on an iOS simulator, ...
Read more >
React-Native: Invariant Violation: Module AppRegistry is not a ...
For me, this was caused by a faulty import statement. The Xcode terminal gave very little detail, so I had to comment out...
Read more >
Untitled
Name of hip hop line dances, Post study work visa uk 2016! ... Mutina dechirer trace cemento, Thermarum latin, Be real game online,...
Read more >
invariant violation: "" has not been registered. this can happen if ...
If does not work, delete the node_modules folder and use yarn install or npm ... Platform(s) (iOS, Android, or both?): both; Device info...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found