# Ionic 3 network information not found

**URL:** <https://forum.ionicframework.com/t/ionic-3-network-information-not-found/144943>\
**Category:** Ionic Native\
**Created:** [October 18, 2018, 8:25pm UTC](https://forum.ionicframework.com/t/ionic-3-network-information-not-found/144943 "2018-10-18T20:25:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Franciskiko](https://avatars.discourse-cdn.com/v4/letter/f/8dc957/32.png) [@Franciskiko](https://forum.ionicframework.com/u/Franciskiko)\
**Post date:** [October 18, 2018, 8:25pm UTC](https://forum.ionicframework.com/t/ionic-3-network-information-not-found/144943/1 "2018-10-18T20:25:52Z")

</div>

I want to check the status of my connection but it does not work, I followed the documentation but it does not work.

app.module.ts

```auto
providers: [
    Network,
    StatusBar,
    SplashScreen,
    {provide: ErrorHandler, useClass: IonicErrorHandler}
  ]

```

login.ts

```auto
export class LoginPage {

  constructor(
    public navCtrl: NavController,
    public navParams: NavParams,
    private network:Network,
  ) {

  }

  ionViewDidLoad() {
    console.log('ionViewDidLoad LoginPage');
  }

  ionViewDidEnter(){
    console.log('ok');
    this.network.onConnect().subscribe(data => console.log(data),err => console.log(err));
    this.network.onDisconnect().subscribe(data => console.log(data),err => console.log(err));
  }

```

the documentation says that this should work but it does not work, I also disconnect my network card and then connect, but it does not detect the change of connected and disconnected

---

<div class="post-metadata">

**Author:** ![cotepatrice](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/cotepatrice/32/122234_2.png) [@cotepatrice](https://forum.ionicframework.com/u/cotepatrice)\
**Post date:** [October 19, 2018, 2:54pm UTC](https://forum.ionicframework.com/t/ionic-3-network-information-not-found/144943/2 "2018-10-19T14:54:45Z")

</div>

Try subscribing in the constructor insted :

```auto
constructor(public toast: ToastController, private network: Network, private platform: Platform) {

    this.network.onConnect().subscribe(() => {
      console.log('network connected!');
      this.toast.create({
        message: 'Network connected',
        duration: 2000
      }).present();
    });

    this.network.onDisconnect().subscribe(() => {
      console.log('network was disconnected :-(');
      this.toast.create({
        message: 'Network disconnected',
        duration: 2000
      }).present();
    });

  }

```

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [July 19, 2021, 9:12pm UTC](https://forum.ionicframework.com/t/ionic-3-network-information-not-found/144943/3 "2021-07-19T21:12:37Z")

</div>

Closed on July 19, 2021, 9:12pm UTC


