How to detect if the device connection is slow?

I know that the cordova plugin only detects if there is some medium connected like the wifi or the data, but I am making an application with ionic 2, that only works with requests and I would like to know if there is a way to do it, to inform the user That your connection is having problems and things like that! Or do not let it continue until you have internet, thanks.

Are you talking about an http request? if so, doesn’t the http request use an observable that you can add a timeout to?

Can’t you use the native network plugin ? (

I never used it but it seems to have an observable.

That’s right, it’s an http, I can not understand it, the way I use the following can you guide me?
This is my role as provider:

public getHijos(id: string) {
     let formPayload = new URLSearchParams();
     formPayload.set('id', id);

var headers = new Headers();
headers.append('Content-Type', 'application/x-www-form-urlencoded');

return'', formPayload, { headers: headers })
  .map((response: Response) => {
    let results = response.json();
    if (results) {
return results;


And this is my controller

getHijo(id : string){
.subscribe(result => {
  if(result != null) {
    console.log("trae el servicio: ", result);
    this.hijos = result.informacionestudiante;