From 5de5a26d3825b3182a7d3a18ed1cbdbb78a3f9aa Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期四, 23 七月 2020 16:39:59 +0800 Subject: [PATCH] 2020-07-23 --- HDL-ON_iOS/AppDelegate.cs | 25 +++++++++++++------------ 1 files changed, 13 insertions(+), 12 deletions(-) diff --git a/HDL-ON_iOS/AppDelegate.cs b/HDL-ON_iOS/AppDelegate.cs index 8bdad2d..0af72b9 100644 --- a/HDL-ON_iOS/AppDelegate.cs +++ b/HDL-ON_iOS/AppDelegate.cs @@ -7,6 +7,7 @@ using Microsoft.AppCenter; using Microsoft.AppCenter.Analytics; using Microsoft.AppCenter.Crashes; +using HDL_ON.UI; namespace SharedMethod { @@ -97,14 +98,14 @@ NSUserDefaults.StandardUserDefaults.SetString(DeviceToken, "PushDeviceToken"); string userPhoneName = UIDevice.CurrentDevice.Name; - UserConfig.Instance.PushDeviceToken = DeviceToken; + OnAppConfig.Instance.PushDeviceToken = DeviceToken; //UserConfig.Instance.phoneName = userPhoneName; //UserConfig.Instance.SaveUserConfig(); } - if (UserConfig.Instance.PushDeviceToken != DeviceToken) + if (OnAppConfig.Instance.PushDeviceToken != DeviceToken) { string userPhoneName = UIDevice.CurrentDevice.Name; - UserConfig.Instance.PushDeviceToken = DeviceToken; + OnAppConfig.Instance.PushDeviceToken = DeviceToken; //UserConfig.Instance.phoneName = userPhoneName; //UserConfig.Instance.SaveUserConfig(); } @@ -147,7 +148,6 @@ public override void DidEnterBackground(UIApplication application) { SharedMethod.SharedMethod.IsBackground = true; - HDL_ON.Entity.DB_ResidenceData.residenceData.SaveResidenceData(); Console.WriteLine("DidEnterBackground"); } @@ -155,7 +155,8 @@ public override void WillEnterForeground(UIApplication application) { SharedMethod.SharedMethod.IsBackground = false; - BusSocket.Start(6000); + //BusSocket.Start(6000); + new AppUnlockPage().LoadPage(); Console.WriteLine("WillEnterForeground"); UIApplication.SharedApplication.ApplicationIconBadgeNumber = 0; } @@ -169,28 +170,28 @@ { Console.WriteLine("OnActivated"); base.OnActivated(application); + } public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions) { - AppCenter.Start("e1add75a-82c6-4a5c-a902-4705b195748e", - typeof(Analytics), typeof(Crashes)); + Shared.Application.IsGpsEnable = true; + AppCenter.Start("e1add75a-82c6-4a5c-a902-4705b195748e",typeof(Analytics), typeof(Crashes)); base.FinishedLaunching(application, launchOptions); SharedMethod.SharedMethod.sharedApp = application; - Shared.Application.IsGpsEnable = false; //NSString* nsCount = [[NSLocale currentLocale] objectForKey: NSLocaleCountryCode]; application.StatusBarStyle = UIStatusBarStyle.DarkContent; string nsCount = NSLocale.CurrentLocale.CountryCode; - if (nsCount != UserConfig.Instance.CountryCode) + if (nsCount != OnAppConfig.Instance.CountryCode) { - UserConfig.Instance.CountryCode = nsCount; - UserConfig.Instance.SaveUserConfig(); + OnAppConfig.Instance.CountryCode = nsCount; + OnAppConfig.Instance.SaveUserConfig(); } application.IdleTimerDisabled = true; application.RegisterForRemoteNotificationTypes(UIRemoteNotificationType.Alert | UIRemoteNotificationType.Badge | UIRemoteNotificationType.Sound); - + Window = new UIWindow(UIScreen.MainScreen.Bounds); var Root = new UINavigationController(new ViewController()) { NavigationBarHidden = true }; Window.RootViewController = Root; -- Gitblit v1.8.0