feat(network-interface): match latest plugin release (#2587)
This commit is contained in:
parent
713efd7206
commit
4f415892b1
@ -10,15 +10,21 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
|||||||
* ```typescript
|
* ```typescript
|
||||||
* import { NetworkInterface } from '@ionic-native/network-interface';
|
* import { NetworkInterface } from '@ionic-native/network-interface';
|
||||||
*
|
*
|
||||||
|
* constructor( private networkInterface: NetworkInterface ) {
|
||||||
*
|
*
|
||||||
* constructor(private networkInterface: NetworkInterface) { }
|
* this.networkInterface.getWiFiIPAddress()
|
||||||
*
|
* .then(address => console.info(`IP: ${address.ip}, Subnet: ${address.subnet}`))
|
||||||
* ...
|
* .catch(error => console.error(`Unable to get IP: ${error}`));
|
||||||
*
|
|
||||||
* this.networkInterface.getWiFiIPAddress(function (ip) { alert(ip); });
|
|
||||||
* this.networkInterface.getCarrierIPAddress(function (ip) { alert(ip); });
|
|
||||||
*
|
*
|
||||||
|
* this.networkInterface.getCarrierIPAddress() {
|
||||||
|
* .then(address => console.info(`IP: ${address.ip}, Subnet: ${address.subnet}`))
|
||||||
|
* .catch(error => console.error(`Unable to get IP: ${error}`));
|
||||||
*
|
*
|
||||||
|
* const url = 'www.github.com';
|
||||||
|
* this.networkInterface.getHttpProxyInformation(url)
|
||||||
|
* .then(proxy => console.info(`Type: ${proxy.type}, Host: ${proxy.host}, Port: ${proxy.port}`))
|
||||||
|
* .catch(error => console.error(`Unable to get proxy info: ${error}`));
|
||||||
|
* }
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
@Plugin({
|
@Plugin({
|
||||||
@ -31,28 +37,32 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
|||||||
@Injectable()
|
@Injectable()
|
||||||
export class NetworkInterface extends IonicNativePlugin {
|
export class NetworkInterface extends IonicNativePlugin {
|
||||||
|
|
||||||
@Cordova()
|
|
||||||
getIPAddress(): Promise<string> {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the WiFi IP address
|
* Gets the WiFi IP address
|
||||||
* @param success {Function} Callback used when successful
|
* @return {Promise<any>} Returns a Promise that resolves with the IP address information.
|
||||||
* @param error {Function} Callback used when failure
|
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
getWiFiIPAddress(): Promise<string> {
|
getWiFiIPAddress(): Promise<any> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the wireless carrier IP address
|
* Gets the wireless carrier IP address
|
||||||
* @param success {Function} Callback used when successful
|
* @return {Promise<any>} Returns a Promise that resolves with the IP address information.
|
||||||
* @param error {Function} Callback used when failure
|
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
getCarrierIPAddress(): Promise<string> {
|
getCarrierIPAddress(): Promise<any> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the relevant proxies for the passed URL in order of application
|
||||||
|
* @param {url} message The message to display.
|
||||||
|
* @return {Promise<any>} Returns a Promise that resolves with the proxy information.
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
getHttpProxyInformation(url: string): Promise<any> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user