Network Interface


Network interface information plugin for Cordova/PhoneGap that supports Android, Blackberry 10, Browser, iOS, and Windows Phone 8.


If you're building a serious project, you can't afford to spend hours troubleshooting. Ionic's experts offer official maintenance, support, and integration help.

Contact Us Today!

Ionic 网络接口 Network Interface插件的安装(Installation)

ionic cordova plugin add cordova-plugin-networkinterface npm install @ionic-native/network-interface
Ionic EE comes with fully supported and maintained plugins from the Ionic Team. Learn More or Contact Us
ionic enterprise register --key=YOURPRODUCTKEY npm install @ionic-enterprise/network-interface

Ionic 网络接口 Network Interface插件支持的平台(Supported Platforms)

  • Android
  • BlackBerry 10
  • Browser
  • iOS
  • Windows
  • Windows Phone

Ionic 网络接口 Network Interface插件的用法(Usage)

import { NetworkInterface } from '@ionic-native/network-interface/ngx';

constructor( private networkInterface: NetworkInterface ) {

    .then(address =>`IP: ${address.ip}, Subnet: ${address.subnet}`))
    .catch(error => console.error(`Unable to get IP: ${error}`));

    .then(address =>`IP: ${address.ip}, Subnet: ${address.subnet}`))
    .catch(error => console.error(`Unable to get IP: ${error}`));

  const url = '';
    .then(proxy =>`Type: ${proxy.type}, Host: ${}, Port: ${proxy.port}`))
    .catch(error => console.error(`Unable to get proxy info: ${error}`));