public static InternetConnectionStatus ( ) : NetworkStatus | ||
return | NetworkStatus |
public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions) { global::Xamarin.Forms.Forms.Init(); Xamarin.Behaviors.Infrastructure.Init(); //window = new UIWindow(UIScreen.MainScreen.Bounds); Database.Instance().Init(new SqliteIOS().GetConnection()); Quickblox.Sdk.Platform.QuickbloxPlatform.Init(); LoadApplication(new App()); // method is new in 1.3 Reachability.ReachabilityChanged += (object sender, EventArgs e) => { UpdateStatus(); }; NetworkStatus internetStatus = Reachability.InternetConnectionStatus(); if (internetStatus != NetworkStatus.NotReachable) { App.IsInternetAvaliable = true; } else { App.IsInternetAvaliable = false; } return(base.FinishedLaunching(application, launchOptions)); }
private void UpdateStatus() { var internetStatus = Reachability.InternetConnectionStatus(); App.IsInternetAvaliable = internetStatus != NetworkStatus.NotReachable; //if (App.IsInternetAvaliable) //{ // if (App.UserId > 0) // MessageProvider.Instance.ConnetToXmpp(App.UserId, App.UserPassword); //} //else //{ // MessageProvider.Instance.DisconnectToXmpp(); //} }