| | |
| | | using Microsoft.AppCenter.Crashes; |
| | | using Shared; |
| | | using Shared.SimpleControl; |
| | | using SmartHome; |
| | | using UIKit; |
| | | using UserNotifications; |
| | | |
| | |
| | | AppCenter.Start ("44cbdfbf-d33e-4e92-a795-1c4452e54d3e", typeof (Analytics), typeof (Crashes)); |
| | | Utlis.WriteLine ("FinishedLaunching"); |
| | | //Shared.Application.IsGpsEnable = false; |
| | | //Shared.Application.IsUsePingFang = true; |
| | | |
| | | base.FinishedLaunching (application, launchOptions); |
| | | |
| | | |
| | | SharedMethod.SharedMethod.sharedApp = application; |
| | | |
| | |
| | | /// </summary> |
| | | void BusSocketStop () |
| | | { |
| | | //进入后台mqtt正在连接重置状态 |
| | | MqttCommon.remoteMqttIsConnecting = false; |
| | | Shared.BusSocket.Stop (); |
| | | closeTime = DateTime.Now; |
| | | } |
| | |
| | | /// </summary> |
| | | void BusSocketStart () |
| | | { |
| | | |
| | | if (closeTime == DateTime.MinValue) { |
| | | closeTime = DateTime.Now; |
| | | } else if (closeTime.AddSeconds (20) < DateTime.Now) { |
| | | } else if (closeTime.AddSeconds (10) < DateTime.Now) { |
| | | if (CommonPage.IsRemote) { |
| | | SmartHome.MqttCommon.DisConnectRemoteMqttClient ("closeTime"); |
| | | MqttCommon.DisConnectRemote ("closeTime", false); |
| | | } |
| | | } |
| | | |
| | | //if (closeTime == DateTime.MinValue) { |
| | | // closeTime = DateTime.Now; |
| | | //} else if (closeTime.AddMinutes (2) > DateTime.Now) { |
| | | // // MqttCommon.DisConnectRemoteMqttClient (); |
| | | //} |
| | | |
| | | var netStatus = (int)Reachability.InternetConnectionStatus (); |
| | | //有些系统版本这里启动比视图控制器快 |
| | |
| | | if (SmartHome.WiFiSet.refreshView != null) { |
| | | SmartHome.WiFiSet.refreshView (); |
| | | } |
| | | |
| | | if (netStatus == 0) |
| | | return; |
| | | } |
| | | } |
| | | } |