Check that WIFI is turned on is React Native iOS app

2766 views ios

Do you know how it is possible to check that WIFI is turned on is React Native iOS app. Due to the aGPS on iOS devices, the WIFI must be turned on in order for our location sensitive app to be able to work effectively and we want to notify the user in cases it is turned off.

Any idea how to achieve this in a React Native app for iOS?

answered question

1 Answer


Use NetInfo to check if the device is connected to wifi/cellular in React Native.

NetInfo exposes info about online/offline status

NetInfo.getConnectionInfo().then((connectionInfo) => {
  console.log('Initial, type: ' + connectionInfo.type + ', effectiveType: ' + connectionInfo.effectiveType);
function handleFirstConnectivityChange(connectionInfo) {
  console.log('First change, type: ' + connectionInfo.type + ', effectiveType: ' + connectionInfo.effectiveType);

For more please visit

posted this

Have an answer?


Please login first before posting an answer.