Network Interface
Network interface information plugin for Cordova/PhoneGap that supports Android, Blackberry 10, Browser, iOS, and Windows Phone 8.
Repo: https://github.com/salbahra/cordova-plugin-networkinterface
Installation
- Install the Cordova and Ionic Native plugins:
$ ionic cordova plugin add cordova-plugin-networkinterface $ npm install --save @ionic-native/network-interface
- Add this plugin to your app's module
Supported platforms
- Android
- BlackBerry 10
- Browser
- iOS
- Windows
- Windows Phone
Usage
import { NetworkInterface } from '@ionic-native/network-interface';
constructor(private networkInterface: NetworkInterface) { }
...
this.networkInterface.getWiFiIPAddress(function (ip) { alert(ip); });
this.networkInterface.getCarrierIPAddress(function (ip) { alert(ip); });
Instance Members
getIPAddress()
getWiFiIPAddress(success, error)
Gets the WiFi IP address
Param | Type | Details |
---|---|---|
success |
Function
|
Callback used when successful |
error |
Function
|
Callback used when failure |
getCarrierIPAddress(success, error)
Gets the wireless carrier IP address
Param | Type | Details |
---|---|---|
success |
Function
|
Callback used when successful |
error |
Function
|
Callback used when failure |