Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 229111

How to Check Network Connection on Every Page

$
0
0

@yashwanth493 Nothing Happen, don’t even hit the condition

if (this.network.type == 'data') {

			let connectSubscription = this.network.onConnect().subscribe(() => {
				console.log("Connected Chers");

				this.navChild.pop();

				this.toast.create({
					message: 'Network Connected',
					duration: 300
				}).present();
			});
			connectSubscription.unsubscribe();
		} else {

			let disconnectSubscription = this.network.onDisconnect().subscribe(() => {
				console.log("Connected Cry");

				this.navChild.push(NetworkCheckPage);

				this.toast.create({
					message: 'Network Disconnected',
					duration: 3000
				}).present();

			})
			disconnectSubscription.unsubscribe();
		}



Viewing all articles
Browse latest Browse all 229111

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>