private static void CheckIfInternetOverTime() { INetworkConnection networkConnection = DependencyService.Get <INetworkConnection>(); networkConnection.CheckNetworkConnection(); if (!networkConnection.IsConnected) { Device.BeginInvokeOnMainThread(async() => { if (hasInternet) { if (!noInterShow) { hasInternet = false; labelScreen.IsVisible = true; await ShowDisplayAlert(); } } }); } else { Device.BeginInvokeOnMainThread(() => { hasInternet = true; labelScreen.IsVisible = false; }); } }
public static async Task <bool> CheckIfInternet() { INetworkConnection networkConnection = DependencyService.Get <INetworkConnection>(); networkConnection.CheckNetworkConnection(); return(networkConnection.IsConnected); }
public bool OnTimerTick() { networkConnection.CheckNetworkConnection(); bool networkStatus = networkConnection.IsConnected; Debug.WriteLine("deteceted:" + networkStatus); if (networkStatus) { Navigation.PushModalAsync(new LoginPage()); return(false); } return(true); }
public static async Task <bool> CheckIfInternetAlert() { INetworkConnection networkConnection = DependencyService.Get <INetworkConnection>(); networkConnection.CheckNetworkConnection(); if (!networkConnection.IsConnected) { if (!noInterShow) { await ShowDisplayAlert(); } return(false); } return(true); }