2018-03-16 22:04:01 +01:00
import { Plugin , Cordova , IonicNativePlugin } from '@ionic-native/core' ;
2017-12-08 20:09:07 +00:00
import { Injectable } from '@angular/core' ;
/**
* @name DNS
* @description A plugin for Apache Cordova that enables applications to manually resolve hostnames into an underlying network address. This is mostly useful for determining whether there is a problem with the device's DNS server configuration.
*
* @usage
* ```typescript
* import { DNS } from '@ionic-native/dns';
*
*
* constructor(private dns: DNS) { }
*
* ...
* this.dns.resolve(hostname)
* .then(
* address => console.log('Resolved ' + hostname + ' to ' + address),
* error => console.log('Failed to resolve ' + hostname + ': ' + error)
* );
*
* ```
*/
@Plugin ( {
pluginName : 'DNS' ,
plugin : 'cordova-plugin-dns' ,
pluginRef : 'cordova.plugins.dns' ,
repo : 'https://bitbucket.org/zegeba/cordova-plugin-dns' ,
platforms : [ 'Android' ]
} )
@Injectable ( )
export class DNS extends IonicNativePlugin {
/**
* Resolve hostnames into an underlying network address.
* @param hostname
* @returns {Promise<string>} Returns a promise that resolves with the resolution.
*/
@Cordova ( )
2018-03-16 22:04:01 +01:00
resolve ( hostname : string ) : Promise < string > { return ; }
2017-12-08 20:09:07 +00:00
}