NetInfo event doesn't fire up | IOS 14.0.1 | Real device
See original GitHub issueEnvironment
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:
- Created 3 years ago
- Reactions:12
- Comments:14 (1 by maintainers)
Top GitHub Comments
@mikehardy latest PR resolved my issue , actually I had some different version
@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