1.0.0 • Published 6 years ago

react-native-network-interfaces-info v1.0.0

Weekly downloads
2
License
MIT
Repository
-
Last release
6 years ago

react-native-network-interfaces-info

Getting started

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

Mostly automatic installation

$ react-native link react-native-network-interfaces-info

Manual installation

Android

  1. Open up android/app/src/main/java/[...]/MainActivity.java
  • Add import com.xen0m.plugin.netifinfo.RNNetworkInterfacesInfoPackage; to the imports at the top of the file
  • Add new RNNetworkInterfacesInfoPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-network-interfaces-info'
    project(':react-native-network-interfaces-info').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-network-interfaces-info/android')
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      compile project(':react-native-network-interfaces-info')

Usage

import RNNetworkInterfacesInfo from 'react-native-network-interfaces-info';

// TODO: What to do with the module?
RNNetworkInterfacesInfo;

To getting all of device's network interfaces: RNNetworkInterfacesInfo.getNetworkInterfacesInfo().then((results) => {

}).catch((error) => { console.log(error) })