From 9c8baf7e7e1169ebdf7d5f7ed33ab29dd5fcbf18 Mon Sep 17 00:00:00 2001 From: JLChen <551775569@qq.com> Date: 星期一, 14 十二月 2020 17:45:17 +0800 Subject: [PATCH] 2020-12-14 1.解锁设置问题修复,增加面容ID验证。2.错误码对接增加。 --- HDL-ON_Android/Application.cs | 58 ++++++++++++++++++++++++++++++++++------------------------ 1 files changed, 34 insertions(+), 24 deletions(-) diff --git a/HDL-ON_Android/Application.cs b/HDL-ON_Android/Application.cs index 1304502..0325145 100644 --- a/HDL-ON_Android/Application.cs +++ b/HDL-ON_Android/Application.cs @@ -49,7 +49,9 @@ string[] permissions = new string[] { Manifest.Permission.WriteExternalStorage, Manifest.Permission.RecordAudio, Manifest.Permission.Camera, Manifest.Permission.ProcessOutgoingCalls, Manifest.Permission.GetAccounts}; - + //绂佹灞忓箷闀夸寒 + BaseActivity.KeepScreenON = false; + //闅愯棌杩嫓铏氭嫙鎸夐敭 BaseActivity.IsHideVirualButtons = true; init(); BaseActivity.OnCreateActoin += (activity, application) => @@ -61,12 +63,7 @@ { Language.CurrentLanguage = "Chinese"; } - //#if DEBUG - - //#else - // //娉ㄥ唽鏋佸厜鎺ㄩ�� - // InitJPush(activity); - //#endif + //鑾峰彇鏋佸厜鎺ㄩ�両D GetJPushRegistrationID(activity); @@ -86,7 +83,7 @@ { Console.WriteLine("HHH 缃戠粶鍙樺寲浣嗗浜庡悗鍙�"); } - + MainPage.InternetStatus = obj; }; }; BaseActivity.RefreshUIAction += (activity) => @@ -97,13 +94,13 @@ BaseActivity.OnResumeAction += (activity) => { checkSomeInfo(); - new HDL_ON.UI.AppUnlockPage().LoadPage(); + }; BaseActivity.OnDestroyAction += (activity) => { Console.WriteLine("OnDestroyAction"); //BusSocket.Stop(); - OnAppConfig.Instance.unlockTime = DateTime.Now; + //UserInfo.Current.unlockTime = DateTime.Now; }; @@ -111,14 +108,23 @@ //Shared.Application.IsGpsEnable = true; - Shared.Application.LocationAction = (arg1, arg2) => + //鑾峰彇缁忕含搴� + Shared.Application.LocationAction = (lon, lat) => { - Shared.Application.LocationAction = null; + try + { + Shared.Application.LocationAction = null; + Shared.Application.StopGPSLocationService(); + new HDL_ON.DAL.Server.HttpServerRequest().GetCityInfo(lon.ToString(), lat.ToString()); + } + catch + { - new HDL_ON.DAL.Server.HttpServerRequest().GetCityInfo(arg1.ToString(), arg2.ToString()); - - MainPage.Log($"缁忕含搴�:::{arg1}:{arg2}"); + } + MainPage.Log($"缁忕含搴�:::{lon}:{lat}"); }; + + } /// <summary> @@ -132,11 +138,11 @@ //淇濆瓨鑾峰彇鐨勬瀬鍏夋湇鍔″櫒涓婄殑娉ㄥ唽ID鍒版湰鍦版枃浠� var tokenID = JPushInterface.GetRegistrationID(activity); Console.WriteLine("RegistrationID: " + tokenID); - if (!string.IsNullOrEmpty(tokenID) && UserInfo.Current.PushDeviceToken != tokenID) + if (!string.IsNullOrEmpty(tokenID) && OnAppConfig.Instance.PushDeviceToken != tokenID) { - UserInfo.Current.PushDeviceToken = tokenID; - UserInfo.Current.PhoneName = Android.OS.Build.Manufacturer; - UserInfo.Current.SaveUserInfo(); + OnAppConfig.Instance.PushDeviceToken = tokenID; + OnAppConfig.Instance.PhoneName = Android.OS.Build.Manufacturer; + OnAppConfig.Instance.SaveConfig(); } int loadTokenCount = 0; System.Threading.Tasks.Task.Run(() => @@ -153,11 +159,11 @@ } } Console.WriteLine("RegistrationID: " + tokenID); - if (!string.IsNullOrEmpty(tokenID) && UserInfo.Current.PushDeviceToken != tokenID) + if (!string.IsNullOrEmpty(tokenID) && OnAppConfig.Instance.PushDeviceToken != tokenID) { - UserInfo.Current.PushDeviceToken = tokenID; - UserInfo.Current.PhoneName = Android.OS.Build.Manufacturer; - UserInfo.Current.SaveUserInfo(); + OnAppConfig.Instance.PushDeviceToken = tokenID; + OnAppConfig.Instance.PhoneName = Android.OS.Build.Manufacturer; + OnAppConfig.Instance.SaveConfig(); } }); @@ -269,6 +275,8 @@ { Console.WriteLine("HHH OnActivityStarted锛歠oreground"); BusSocketStart(); + //鍚庡彴鍥炲埌鍓嶅彴 + new HDL_ON.UI.AppUnlockPage().LoadPage(); } } @@ -280,6 +288,9 @@ { Console.WriteLine("HHH OnActivityStopped锛� background"); BusSocketStop(); + //杩涘叆鍚庡彴 + UserInfo.Current.unlockTime = DateTime.Now; + } } @@ -304,7 +315,6 @@ { IsEnterBackground = true; //BusSocket.Stop(); - OnAppConfig.Instance.unlockTime = DateTime.Now; } -- Gitblit v1.8.0