Please provide the following:
- SDK Version: 44
- Platforms(Android/iOS/web/all): Android/iOS
- Add the appropriate “Tag” based on what Expo library you have a question on.
So, I’ve been using the library
@react-native-community/netinfo to determine if the device is on the internet before making requests. But in my Sentry.io logs I am still getting errors of timeouts and cannot lookup domain names from clients randomly. These are people connected to WiFi that is probably wanting the user to login. Which is fine as my App retries. However, it proves netinfo isn’t that useful.
Then I found expo-network and
getNetworkStateAsync() which is even better because it will check for
isInternetReachable (Android is my main userbase). Which is great!
The problem is that what I really need is to
addEventListener for when that boolean changes. Currently I have to use
netinfo for the event and when that triggers I test
Ideally, it would be nice if
expo-network had the event and I didn’t have to bring in both libraries. Any chance Expo could add an event to
isConnected changes and/or