Quantcast
Viewing all articles
Browse latest Browse all 229956

How to Check Network Connection on Every Page

@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 229956

Trending Articles