title: How to find My Wifi has internet or Not Ionic 2?
body: <p>I have created an application in ionic 2 where I check the Network availability. My app does not show when network is established. I want to check if connection has internet or not? How do we check the connected network has internet connection or not using Ionic 2? </p>
  
  <pre><code>import { Component } from '@angular/core';
  import { NavController, ToastController } from 'ionic-angular';
  
  import { Network } from '@ionic-native/network';
  
  @Component({
    selector: 'page-home',
    templateUrl: 'home.html'
  })
  export class HomePage {
  
    constructor(private toast: ToastController, private network: Network, public navCtrl: NavController) {
    }
  
    ionViewDidEnter() {
  
      this.network.onConnect().subscribe(data =&gt; {
        console.log(data)
        this.displayNetworkUpdate(data.type);
      }, error =&gt; console.error(error));
  
      this.network.onDisconnect().subscribe(data =&gt; {
        console.log(data)
        this.displayNetworkUpdate(data.type);
      }, error =&gt; console.error(error));
    }
  
    displayNetworkUpdate(connectionState: string){
      let networkType = this.network.type
      this.toast.create({
        message: `You are now ${connectionState} via ${networkType}`,
        duration: 3000
      }).present();
    }
  
  
  }
  </code></pre>