0
I am developing an application in Ionic 2 ts, but when I try to check if it is connected on the internet it returns 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 ?
You followed these steps?
– Bruno Peres
Yes, but I only put the network.type, without connecting disconnects... But I put in the appmodule everything...
– Augusto Furlan
Now it worked, I tested it on iPhone, not emulator
– Augusto Furlan