i am using react-native-netinfo in my app. In iOS it's working fine. But in android always returns true. It doesn't have internet connection (WiFi or Mobile data). It still returns true. Please give me any suggestions.
Versions:-
react-native:- 0.61.4,
@react-native-community/netinfo:- 4.6.1
Here is my code:-
componentDidMount() {
NetInfo.isConnected.addEventListener(
'connectionChange',
this.handleConnectivityChange,
);
}
handleConnectivityChange = isConnected => {
console.log('uyeuiyiuyiu', isConnected);
this.setState({
connectionStatus: isConnected,
});
};
componentWillUnmount() {
NetInfo.isConnected.removeEventListener(
'connectionChange',
this.handleConnectivityChange,
);
}