Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including react-native-network-info with all npm packages installed. Try it out:

require("react-native/package.json"); // react-native is a peer dependency. var reactNativeNetworkInfo = require("react-native-network-info")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

react-native-network-info v3.1.0

Get local network information


React Native library for getting information about the devices network


Version 3+ requires RN 0.47 or higher Version 2+ requires RN 0.40 - RN 0.46


npm install react-native-network-info --save


yarn add react-native-network-info

Automatic Install

react-native link

Manual Install


  1. In XCode, in the project navigator, right click Libraries ➜ Add Files to [your project's name]

  2. Go to node_modules ➜ react-native-network-info and add the .xcodeproj file

  3. Add RNNetworkInfo.a to Build Phases -> Link Binary With Libraries

Run your project (Cmd+R)


  1. Add the following lines to android/settings.gradle:

    include ':react-native-network-info'
    project(':react-native-network-info').projectDir = new File(settingsDir, '../node_modules/react-native-network-info/android')
  2. Update the android build tools version to 2.2.+ in android/build.gradle:

    buildscript {
        dependencies {
            classpath '' // <- USE 2.2.+ version
  3. Update the gradle version to 2.14.1 in android/gradle/wrapper/

  4. Add the compile line to the dependencies in android/app/build.gradle:

    dependencies {
        compile project(':react-native-network-info')
  5. Add the import and link the package in

    import com.pusherman.networkinfo.RNNetworkInfoPackage; // <-- add this import
    public class MainApplication extends Application implements ReactApplication {
        protected List<ReactPackage> getPackages() {
            return Arrays.<ReactPackage>asList(
                new MainReactPackage(),
                new RNNetworkInfoPackage() // <-- add this line


import { NetworkInfo } from 'react-native-network-info';

// Get Local IP
NetworkInfo.getIPAddress(ip => {

// Get IPv4 IP (Android Only)
NetworkInfo.getIPV4Address(ipv4 => {

// Get SSID
NetworkInfo.getSSID(ssid => {

// Get BSSID
NetworkInfo.getBSSID(ssid => {

Dev Notes

Notes on how this package was made can be found here.

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free