How to check if there is internet connection on app load. I tried onDisconnect
and onConnect
only works if we connect or disconnect while we are in the middle of running the app.
I even tried this -----
if(!this.network.type){
let alert = this.alertCtrl.create({
title: 'No network',
message: 'Check your internet connection',
buttons: [{
text: "OK",
handler: () => { this.platform.exitApp(); }
}]
})
alert.present();
}