wxr
2023-07-27 2a569c260ba032c914da446afd1af4215bdc976c
IOS闪退捕获增加
2个文件已修改
36 ■■■■ 已修改文件
HDL-ON_iOS/AppDelegate.cs 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/AppDelegate.cs
@@ -3,10 +3,9 @@
using HDL_ON;
using Shared;
using UIKit;
using UserNotifications;
using HDL_ON.UI;
using HDL_ON.DAL.Server;
using Intents;
using System.Threading.Tasks;
namespace SharedMethod
{
@@ -292,6 +291,22 @@
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            #region 异常捕获 2023-07-27 17:37:04
            AppDomain.CurrentDomain.UnhandledException += (sender, e) => {
                if(e.ExceptionObject is Exception exception)
                {
                    Console.WriteLine("未处理的异常:" + exception.Message);
                }
            };
            TaskScheduler.UnobservedTaskException += (sender, e) => {
                if (e.Exception is Exception exception)
                {
                    Console.WriteLine("未处理的异常:" + exception.Message);
                }
            };
            #endregion
            //设置全视通状态
            //string systemVersion = UIKit.UIDevice.CurrentDevice.SystemVersion;
HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
@@ -1450,13 +1450,16 @@
                    string url = $"h5/index.html?homeId={DB_ResidenceData.Instance.CurrentRegion.id}&token={UserInfo.Current.AccessToken}&refresh_token={UserInfo.Current.RefreshToken}&url={OnAppConfig.Instance.RequestHttpsHost}&language={lz}";
                    Inverter.Ins.ShowWebviewFormUrl(url);
                    //new System.Threading.Thread(() =>
                    //{
                    //    System.Threading.Thread.Sleep(2000);
                    //    var status = new Dictionary<string, object> { ["method"] = "weather", ["data"] = "MainPage.cityInfo.weather" };
                    //    Inverter.Ins.H5Page.CallJS($"nativeToJs(\'{Newtonsoft.Json.JsonConvert.SerializeObject(status)}\')");
                    //})
                    //{ IsBackground = true }.Start();
                    new System.Threading.Thread(() =>
                    {
                        System.Threading.Thread.Sleep(2000);
                        Application.RunOnMainThread(() =>
                        {
                            var status = new Dictionary<string, object> { ["method"] = "weather", ["data"] = MainPage.cityInfo.weather };
                            Inverter.Ins.H5Page.CallJS($"nativeToJs(\'{Newtonsoft.Json.JsonConvert.SerializeObject(status)}\')");
                        });
                    })
                    { IsBackground = true }.Start();
                    Inverter.Ins.H5Page.JSToNativeAction = (dictionary) =>
                    {
#if __IOS__