📄 expo/versions/v52.0.0/sdk/netinfo

File: netinfo.md | Updated: 11/15/2025

Source: https://docs.expo.dev/versions/v52.0.0/sdk/netinfo

Hide navigation

Search

Ctrl K

Home Guides EAS Reference Learn

Reference version

SDK 52

Archive Expo Snack Discord and Forums Newsletter

NetInfo

GitHub npm

A cross-platform API that provides access to network information.

GitHub npm

Android

iOS

tvOS

Web

Bundled version:

11.4.1

Copy page


@react-native-community/netinfo allows you to get information about connection type and connection quality.

Installation


Terminal

Copy

- npx expo install @react-native-community/netinfo

If you are installing this in an existing React Native app , make sure to install expo in your project. Then, follow the installation instructions provided in the library's README or documentation.

API


To import this library, use:

import NetInfo from '@react-native-community/netinfo';

If you want to grab information about the network connection just once, you can use:

NetInfo.fetch().then(state => { console.log('Connection type', state.type); console.log('Is connected?', state.isConnected); });

Or, if you'd rather subscribe to updates about the network state (which then allows you to run code/perform actions anytime the network state changes) use:

const unsubscribe = NetInfo.addEventListener(state => { console.log('Connection type', state.type); console.log('Is connected?', state.isConnected); }); // To unsubscribe to these update, just use: unsubscribe();

Accessing the SSID


To access the ssid property (available under state.details.ssid), there are a few additional configuration steps:

Android and iOS

iOS only

  • Add the com.apple.developer.networking.wifi-info entitlement to your app.json under ios.entitlements:

    app.json

    Copy

    "ios": { "entitlements": { "com.apple.developer.networking.wifi-info": true } }

  • Check the Access Wi-Fi Information box in your app's App Identifier, which can be found here .

  • Rebuild your app with eas build --platform ios or npx expo run:ios .

For more information on API and usage, see react-native-netinfo documentation .