Need to run background process when internet is connected.
Is there any plugins available in ionic 3,cordova
export class MyApp {
constructor (
private network: Network,
private platform: Platform,
private alertCtrl: AlertController,
) {
platform.ready().then(() => {
this.listenConnection();
})
}
private listenConnection(): void {
this.network.onDisconnect()
.subscribe(() => {
this.showAlert();
});
}
private showAlert(): void {
// omitted;
}
}
How to check internet connection background