wxr
2023-05-16 032a22c21bc9b2adb6b9ff3201433522a335df57
HDL-ON_iOS/AppDelegate.cs
@@ -4,9 +4,6 @@
using Shared;
using UIKit;
using UserNotifications;
using Microsoft.AppCenter;
using Microsoft.AppCenter.Analytics;
using Microsoft.AppCenter.Crashes;
using HDL_ON.UI;
using HDL_ON.DAL.Server;
using Intents;
@@ -262,7 +259,7 @@
                {
                    Language.CurrentLanguage = "russian";
                }
                else if (NSLocale.PreferredLanguages[0].Contains( "bul"))
                else if (NSLocale.PreferredLanguages[0].Contains("bul"))
                {
                    Language.CurrentLanguage = "български";
                }
@@ -290,7 +287,7 @@
            Console.WriteLine("111111111111");
            SetCurrentLanguage();
            //Shared.Application.FontSize = 12;
            //Bugly.Bugly.StartWithAppId("b58fb35436");
            Bugly.Bugly.StartWithAppId("1dc40c170a");
            //取消EditText默认密码输入方式
            //Shared.Application.IsEditTextContentTypePassword = false;
            //默认使用苹方字体
@@ -303,8 +300,6 @@
            rootViewController = new UINavigationController(new ViewController()) { NavigationBarHidden = true };
            Window.RootViewController = rootViewController;
            Window.MakeKeyAndVisible();
            AppCenter.Start("e1add75a-82c6-4a5c-a902-4705b195748e", typeof(Analytics), typeof(Crashes));
            SharedMethod.SharedMethod.sharedApp = application;
            //NSString* nsCount = [[NSLocale currentLocale] objectForKey: NSLocaleCountryCode];
@@ -327,10 +322,11 @@
            return true;
        }
        /// <summary>
        /// 处理通知消息
        /// </summary>
        void HandleNotificationMessageUserInfo(NSDictionary userInfo, bool bFinishedLaunching)
            /// <summary>
            /// 处理通知消息
            /// </summary>
            void HandleNotificationMessageUserInfo(NSDictionary userInfo, bool bFinishedLaunching)
        {
            try
            {
@@ -397,7 +393,7 @@
                        UserInfo.Current.pushMessageInfo = pushMes;
                        UserInfo.Current.inCall = DateTime.Now;
                    }
                    if (bFinishedLaunching)
                    {
                        if (pushMes.Extras != null)
@@ -413,13 +409,15 @@
                            }
                            else
                            {
                                HDLCommon.Current.AdjustPushMessage(pushMes);
                                //HDLCommon.Current.AdjustPushMessage(pushMes);
                                this.CommonAdjustPushMessage(pushMes);//2023年04月13日15:55:54 修改
                            }
                        }
                    }
                    else
                    {
                        HDLCommon.Current.AdjustPushMessage(pushMes);
                        //HDLCommon.Current.AdjustPushMessage(pushMes);
                        this.CommonAdjustPushMessage(pushMes);
                    }
                   
                }
@@ -494,12 +492,33 @@
            MainPage.IsEnterBackground = false;
            HDL_ON.DriverLayer.UdpSocket._BusSocket.Start();
            //重连mqtt防止mqtt进入假死状态 2023-05-03 22:55:12 wxr
            HDL_ON.DAL.Mqtt.MqttClient.InitState();
            new AppUnlockPage().LoadPage();
            UIApplication.SharedApplication.ApplicationIconBadgeNumber = 0;
            HDL_ON.DriverLayer.Control.Ins.SearchLoaclGateway();
        }
        public  void CommonAdjustPushMessage(JPushMessageInfo pushMes)
        {
            new System.Threading.Thread(new System.Threading.ThreadStart(() =>
            {
                while (MainPage.BasePageView == null)
                {
                    System.Threading.Thread.Sleep(300);
                }
                Shared.Application.RunOnMainThread(() =>
                {
                    HDLCommon.Current.AdjustPushMessage(pushMes);
                });
            })).Start();
        }
    }
}