reachability request not being called
See original GitHub issueEnvironment
System:
OS: Linux 5.4 Ubuntu 20.04 LTS (Focal Fossa)
CPU: (12) x64 Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz
Memory: 9.73 GB / 31.28 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 10.19.0 - /usr/bin/node
Yarn: 1.22.4 - /usr/bin/yarn
npm: 6.14.4 - /usr/bin/npm
Watchman: 4.9.0 - /usr/bin/watchman
SDKs:
Android SDK:
API Levels: 23, 25, 28, 29
Build Tools: 28.0.3, 29.0.0, 29.0.2
System Images: android-29 | Google Play Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: Not Found
Languages:
Java: 1.8.0_252 - /usr/bin/javac
Python: Not Found
npmPackages:
@react-native-community/cli: Not Found
react: 16.11.0 => 16.11.0
react-native: 0.62.2 => 0.62.2
npmGlobalPackages:
*react-native*: Not Found
Platforms
- Android
Versions
- Android: 10
- iOS: -
- react-native-netinfo: 5.9.5
- react-native: 0.62.2
- react: 16.11.0
Description
I’m expecting useNetInfo
send a request to my URL and determine application connectivity state. But it’s not working on Android. Even returning reachabilityTest
as false won’t work.
Reproducible Demo
const netInfo = useNetInfo({
reachabilityUrl: baseURL,
reachabilityTest: async (response) => {
console.log(response);
return false;
},
reachabilityLongTimeout: 60 * 1000,
reachabilityShortTimeout: 5 * 1000,
reachabilityRequestTimeout: 15 * 1000,
});
Issue Analytics
- State:
- Created 3 years ago
- Reactions:10
- Comments:5 (1 by maintainers)
Top Results From Across the Web
reachability request not being called · Issue #395 - GitHub
I'm expecting useNetInfo send a request to my URL and determine application connectivity state. But it's not working on Android.
Read more >objective c - Reachability Notification Never Called
Your object Reachability is autorelease so it's dealloc and not working anymore. I try your code and it's working for me: AppDelegate.h code...
Read more >Working with an Internet Connection on iOS with Swift
How to handle Internet Connection on iOS with Swift? Why you shouldn't use Reachability to check network status on iOS?
Read more >What is Reachability Analyzer? - Amazon Virtual Private Cloud
Reachability Analyzer is a configuration analysis tool that enables you to perform connectivity testing between a source resource and a destination resource ...
Read more >Reachability in iOS. Reachability no more….NWPathMonitor
Note: Reachability cannot tell your application if you can connect to a ... iOS Developer working with Swift and Objective-C Worked @X-Team, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@hamidfzm i was checking this error i think the library do the right things: look the image:
I tested when your device is android will return directly isInternetReachable variable from native code. so the code of reachabilityTest will not be executed it only will be executed when native code return
typeof state.isInternetReachable !== boolean
i hope this comment can help you =)
It does not appear based on the docs that you may specify a custom reachabilityTest @chrise86 - when you inspected the code here, does my assertion agree with your analysis?
Similar to this someone just added the ability to pass in a function that determines whether to run reachability tests or not #513 - it was done in a backwards-compatible way (the default function is the way it worked before). If you posted a PR like that we could merge it