Questions tagged [react-native-community-netinfo]

61 questions
1
vote
1 answer

How to check internet is disconnected but VPN connected in react native app

I connected to the internet and then connect to VPN now, I disconnected the internet and checked the network connectivity status in my application, and I am getting connected to netinfo. Can anyone help to know how can we know if the internet is…
Chandni
  • 692
  • 1
  • 10
  • 25
1
vote
4 answers

Issue with netinfo react native

i want to render specific screen when the app loose internet connexion, the attached code works one time when the app is opened from background. any advices import { useNetInfo } from '@react-native-community/netinfo'; export default () =>…
1
vote
3 answers

React native Connection status on background / locked screen NetInfo

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. Even I tried to re-fetch the state still using NetInfo.fetch() return the same…
1
vote
0 answers

React Native's NetInfo different behaviour on iOS and Android

I am using NetInfo from @react-native-community/netinfo My UseEffect Code is: useEffect(() => { const checkNet = NetInfo.addEventListener((state) => { if(!state.isConnected){ setShowModal("internet") } …
1
vote
0 answers

How to use setTimeout in react native?

Hi I working on a react native project I need to support my app offline. I used NetInfo Library from expo documentation. like below const netInfo = useNetInfo(); const networkCheck = () => { setTimeout(() => { const net =…
1
vote
2 answers

Item not displaying when pushing data from asyncstorage to array object in React Native?

I am creating an App in React Native Expo and trying to display data using asyncstorage. The only data which is showing is of static array which I have declared in var temp but when I push the received item in var temp it is not displaying that. I…
1
vote
1 answer

React-native offline package not working properly

react-native offline package not working properly on continuous internet connection change. My issue is, https://github.com/rgommezz/react-native-offline/issues/300 It updated with time delay, Anyone faced this issue, please reply to this.
1
vote
2 answers

NetInfo crash in android

I'm using NetInfo to get the connection but some devices android crash with that LOG: Error Tag: Mini App Bundle Message: null Stack: android.net.ConnectivityManager$TooManyRequestsException at…
Anhdevit
  • 1,926
  • 2
  • 16
  • 29
1
vote
2 answers

Display button based upon Internet connection status in React Native?

I am still somewhat new to React Native. I am attempting to detect the user's Internet connectivity status and display a button based upon the result. I would like to exit the app if no Internet connection is detected. My full code is as…
1
vote
3 answers

Writing a unit test to check if the app is offline in react-native

I have the following component which displays a text on the app if the app is offline. import React from 'react'; import { useNetInfo } from '@react-native-community/netinfo'; import { Label } from 'components/ui'; const OfflineNotice = () => { …
1
vote
1 answer

Auto update Net Info status in react-native

I am using https://github.com/react-native-community/react-native-netinfo to check network connection in my react-native app. How can fetch network connection automatically when Network is lost and the Network is back again? Below is the code I…
Pratap Penmetsa
  • 1,137
  • 17
  • 41
1
vote
2 answers

React-Native NetInfo dosen't work after once did work?

I'm new at react-native I have a problem about internet connection check. When I open my app and disconnect for internet(wifi or cellular both) I got a alert message that's what I want. But when I connect again to internet and try again I see in my…
1
vote
0 answers

The key isInternetReachable is always returning false for a minute in iOS whenever the app comes to foreground from background in react-native

Platforms This issue is related to iOS. Versions iOS: 12.4.1 react-native-netinfo: "^5.5.0" react-native: "0.61.5" react: "16.9.0" Description I'm working on implementing network status check in a project with dynamic data and checking for…
Sahitya D
  • 154
  • 3
  • 10
1
vote
1 answer

Aws-amplify not working with react-native and expo version 36.0.0

I'm currently working on a react-native-app using expoSdk which is supposed to run on web,ios and android. The most challenging part till now has been to setup the navigation which I finally did. Now I added amplify to my project but the project…
1
vote
2 answers

NetInfo.addEventListener is called twice in component did mount in IOS

When app lunches, componentDidMount is called and then NetInfo.addEventListener is called twice. Is any solution of it. My code is: class OfflineMessage extends PureComponent { state = { isConnected: true }; componentDidMount() { …
Ravi Sharma
  • 507
  • 6
  • 21