React Native Network Info

screenshot of React Native Network Info
react-native

React Native library for getting information about the devices network

Overview

react-native-network-info is a React Native library designed to provide information about the device's network. It offers a convenient way to access network-related details on both iOS and Android platforms.

Features

  • Version Compatibility: Version 3+ requires RN 0.47 or higher, while Version 2+ works with RN 0.40 - RN 0.46.
  • Easy Installation: Links the library automatically for React Native >= 0.60, removing the need for manual linking.
  • Platform Support: Works seamlessly on both iOS and Android devices.

For React Native >= 0.60

npm install react-native-network-info
cd ios && pod install && cd ..

For React Native < 0.60

npm install react-native-network-info
react-native link react-native-network-info

For manual linking on iOS:

  1. Add the .xcodeproj file in XCode.
  2. Add RNNetworkInfo.a to Build Phases -> Link Binary With Libraries.
  3. Run your project.

For Android:

  1. Update settings.gradle and build.gradle files as specified.
  2. Import and link the package in MainApplication.java.

Summary

react-native-network-info is a versatile library that simplifies the retrieval of network information in React Native applications. With straightforward installation instructions and support for both iOS and Android platforms, it enhances the development experience for accessing network-related details.

react-native
React Native

React Native is a framework for building mobile applications using React and JavaScript. It enables developers to write once and deploy to multiple platforms, including iOS, Android, and the web, while providing a native app-like experience to users.