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); NetInfo.removeEventListener( 'connectionChange', handleFirstConnectivityChange ); } NetInfo.addEventListener( 'connectionChange', handleFirstConnectivityChange );
this is a copy of the code in the relevant documentation , the effective type indicates whether the network is 2G, 3G, EDGE or 4G.
source share