Connection on background / locked screen
See original GitHub issue“@react-native-community/netinfo”: “^7.1.2”,
Description
When the app is running in a background state or Locked, When the user unlock or foreground the app, useNetInfo(); hook return as isConnected as false
Its happening in Android real device connected to Wifi
Code:
const netInfo = useNetInfo();
const [show, setShow] = useState(false);
useEffect(() => {
setShow(!(netInfo.isConnected && netInfo.isInternetReachable));
}, [netInfo]);
useEffect(() => {
fetchConnection();
}, []);
const fetchConnection = () => {
NetInfo.fetch().then((state: any) => {
setShow(!(state.isConnected && state.isInternetReachable));
});
};
Issue Analytics
- State:
- Created 2 years ago
- Reactions:10
- Comments:18 (7 by maintainers)
Top Results From Across the Web
React native Connection status on background / locked ...
I fixed this issue by reverting the package version into "@react-native-community/netinfo": "5.9.7" , Also, change the androidXCore version ...
Read more >Control access to information on the iPhone Lock Screen
Go to Settings > Face ID & Passcode (on an iPhone with Face ID) or Touch ID & Passcode (on an iPhone with...
Read more >Configure Windows Spotlight on the lock screen
In Windows 10, version 1703, you can use the Personalization CSP settings to set lock screen and desktop background images. What does Windows ......
Read more >How to Find Windows Spotlight Lock Screen Images in ... - Alphr
... a series of gorgeous images from Bing as your lock screen background. ... Based on your Internet connection speed, it may take...
Read more >Fix Windows Spotlight Lock Screen Picture Not Changing
Let Apps Run in the Background · Disable Metered Internet Connections · Reset Windows Spotlight · Reset Spotlight Settings Using PowerShell · You...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
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
To be perfectly clear on status: there will be no secret updates. It’s open source. Everything will happen in the open. If you don’t see a comment saying there is an update, there isn’t one. Do not post a useless comment saying “any update” or “same issue”.
it’s a problem, this issue logs it, so here we are.
If you have the time or can convince your company it’s useful enough to spend the time to dig in and fix it, please comment that you are doing that. And post a PR.
I do not have any more free time to offer this module with no personal purpose, and this issue is not affecting me or my projects so I will not be working on it.
Hopefully someone has the time, a PR would be highly appreciated and I can collaborate to get it merged and released
Cheers
Please post a PR, it’s open source.no one just fixes things for you nor should you expect it. You may pin core to 1.6.0 if you don’t want to contribute back.