Questions tagged [react-native-community-netinfo]

61 questions
0
votes
1 answer

Handler is not a function using eventChannel from redux-saga

I'm trying to listen the network status using eventChannel from redux saga like this: import {put, take} from 'redux-saga/effects'; import {eventChannel} from 'redux-saga'; import NetInfo from '@react-native-community/netinfo'; export function*…
rayashi
  • 1,721
  • 3
  • 20
  • 28
0
votes
0 answers

How to set up an event listener using the latest version of @react-native-community/netinfo?

I've been trying to set up an event listener to get connection changes using the latest version of @react-native-community/netinfo and redux-saga, but I could not make it work. Could you help me? This code used to work in previously…
0
votes
2 answers

NetInfo usage pattern in React Native

I'm trying to create a robust pattern in my React Native app so that if Internet connection is not there, I won't make API calls but display a "Connection lost..." message. I created the following util function and trying to incorporate it into my…
Sam
  • 26,817
  • 58
  • 206
  • 383
0
votes
3 answers

How do i access Reusable NetInfo code from function component to Class Component

I have created a custom function component which has eventlistener from NetInfo for internet connection, which returns a bool value and method name. I wanted to call the method in every class component to check the internet connect and use the bool…
0
votes
1 answer

@react-native-community/netinfo release build fail

While I am making a release build in "react-native": "0.62.2" and "@react-native-community/netinfo": "^5.9.3" Any help would be appreciated. I am getting this error.
0
votes
1 answer

React Native - undefined is not an object (evaluating '_get2.queue')

I'm trying to find a way to know when a user is connected and when he disconnects, so that when he disconnects, I save his actions offline and when he connects again, I send them to the server. I'm using Redux Saga, Redux Offline Queue and Netinfo…
0
votes
2 answers

Using @react-native-community/netinfo in a class, possible?

I'm trying to add to my application a function to add a view indicating to the user that he is disconnected from the internet network. So I went to @react-native-community/netinfo to set it up but I quickly found myself confronted with the…
0
votes
1 answer

How to get NetInfo working with expo-web?

I tried to use the NetInfo example from the expo docs: https://docs.expo.io/versions/latest/sdk/netinfo/ When I am compiling for web, the compiling fails with TypeError: NetInfo.addEventListener is not a function (anonymous…
0
votes
1 answer

react-native-community / react-native-netinfo listners are not working on android

state = { isConnected: null, }; componentDidMount() { this._netWorkConnection(); } componentWillUnmount() { this._netWorkConnection(); } _netWorkConnection = () => { …
0
votes
1 answer

Clear the app data if disconnected from internet for more then 5min in react native

I want to clear the react native app data if my app is disconnected from internet for more than 5 min. I am using react native NetInfo to check network connectivity status. Saving the time when app disconnected and checking when it will reconnect to…
0
votes
1 answer

NetInfo removed from React Native error even after upgrading to 'react-native-community/netinfo'

Invariant Violation: NetInfo has been removed from React Native. It can now be installed and imported from 'react-native-netinfo' instead of 'react-native' Getting the above error even after updating react-native-netinfo to…
Ajay Sivan
  • 2,807
  • 2
  • 32
  • 57
0
votes
0 answers

I want to use NetInfo React Native, my NetInfo function can be used in all components?

componentDidMount() { NetInfo.isConnected.addEventListener( 'connectionChange', this._handleConnectivityChange ); NetInfo.isConnected.fetch().done((isConnected) => { if(isConnected == true) { …
0
votes
1 answer

How can i setInterval outside class extends Component?

I want to setInterval connection check but it's not working for me. Can someone explain to me why and how can i do it? Thank you! import React, { Component } from 'react'; import { StyleSheet, TouchableWithoutFeedback, Keyboard, Text, View,…
0
votes
0 answers

NetInfo addeventListener has a weird behaviour on ios

Importing NetInfo from 'react-native' works very well on iOS and android. Although, now trying to import it from @react-native-community/netinfo (version 3.2.1) working on android with no problems but on iOS launching in a repetitive way the…
stuudd
  • 329
  • 2
  • 9
  • 16
0
votes
2 answers

can not install react-native-community/react-native-netinfo

I want to remove "Warning: NetInfo has been extracted from react-native core and will be removed in a future release. It can now be installed and imported from '@react-native-community/netinfo' instead of 'react-native'. See…
Bishwa Timilsina
  • 1,053
  • 9
  • 11