react-native-network-interfaces-info
v1.0.0
Published
## Getting started
Downloads
2
Maintainers
Readme
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
- 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 thegetPackages()
method
- 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')
- 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) })