Ionic 2 network.type = null

0

I'm developing an application in ionic 2 ts, but when I try to check if it's connected to the internet it returns me null. My code

import { Network } from '@ionic-native/network';


@Component({
  selector: 'page-home',
  templateUrl: 'home.html',
  providers: [ProviderAccessApi]
})
export class HomePage {
  user : string;
  pass:string;

  constructor(public navCtrl: NavController, public providerAPI:ProviderAccessApi, private platform: Platform, public alertCtrl : AlertController, public network : Network) {
      console.log('HomePage carragada com sucesso')
      alert(network.type);
  }

How can I fix it?

    
asked by anonymous 02.06.2017 / 14:41

0 answers