JLChen
2020-06-05 f86c8b5dcf5c84386745b009fc4115fa9db3b76d
SmartHome/ON/Application.cs
@@ -56,7 +56,7 @@
            Locale locale1 = Locale.Default;
            var localeList = Resources.Configuration.Locale;
            //if(localeList.Language == "zh") {
                //Language.CurrentLanguage = "Chinese";
            //Language.CurrentLanguage = "Chinese";
            //}
            string [] permissions = new string [] { Manifest.Permission.WriteExternalStorage, Manifest.Permission.RecordAudio,
@@ -129,7 +129,7 @@
                    while (string.IsNullOrEmpty (tokenID)) {
                        System.Threading.Thread.Sleep (1000);
                        tokenID = JPushInterface.GetRegistrationID (activity);
                        Console.WriteLine ("Sleep.tokenID + "+ JPushInterface.GetRegistrationID (activity));
                        Console.WriteLine ("Sleep.tokenID + " + JPushInterface.GetRegistrationID (activity));
                        loadTokenCount++;
                        if (loadTokenCount > 30) {
                            break;
@@ -144,14 +144,14 @@
#endif
                BaseActivity.NetworkStateChanged += (int obj) => {
                    MqttCommon.DisConnectRemoteMqttClient("NetworkStateChanged") ;
                    MqttCommon.DisConnectRemoteMqttClient ("NetworkStateChanged");
                    Shared.SimpleControl.EquipmentPublicClass.CheckLinkRemote (obj);
                };
            };
            BaseActivity.RefreshUIAction += (activity) => {
                MainPage.Show ();
                    checkSomeInfo ();
                checkSomeInfo ();
            };
            BaseActivity.OnResumeAction += (activity) => {
                //new System.Threading.Thread (() => {
@@ -159,7 +159,7 @@
                //        System.Threading.Thread.Sleep (50);
                //    }
                MqttCommon.DisConnectRemoteMqttClient ();
                    checkSomeInfo ();
                checkSomeInfo ();
                Console.WriteLine ("Close OnResumeAction!!!");
                WiFiSet.refreshView?.Invoke ();
            };
@@ -178,7 +178,8 @@
            //设置极光调试模式,为false时只打印警告信息
            JPushInterface.SetDebugMode (false);
            JPushInterface.Init (this);//保存手机名称到本地文件
            //获取经纬度
            //获取经纬度
            MainPage.AirQuality = new AirQuality ();
            Shared.Application.LocationAction = (arg1, arg2) => {
                Shared.Application.LocationAction = null;
                System.Threading.Tasks.Task.Run (() => {
@@ -280,7 +281,7 @@
        "cn.jpush.android.intent.NOTIFICATION_OPENED",
        "cn.jpush.android.intent.CONNECTION"
        },
               Categories = new string [] { "com.hdl.on" })
               Categories = new string [] { "com.hdl.in" })
           ]
    public class JpushNotificationReceiver : BroadcastReceiver
    {
@@ -301,9 +302,8 @@
                else if (JPushInterface.ActionRegistrationId == intent.Action) {
                    string regId = bundle.GetString (JPushInterface.ExtraRegistrationId);
                    //System.Console.WriteLine ("Registration ID:" + regId);
                }
                else if (JPushInterface.ActionNotificationOpened == intent.Action) {
                Console.WriteLine ("用户点击打开了通知");
                } else if (JPushInterface.ActionNotificationOpened == intent.Action) {
                    Console.WriteLine ("用户点击打开了通知");
                    Application.IsShowTip = false;
                    if (Shared.Application.Activity == null) {
@@ -312,7 +312,7 @@
                        context.StartActivity (tempIntent);
                    } else {
                        (Shared.Application.Activity as BaseActivity).MoveToFront ();
                        RemoteInfo.Current.ReadMsgList ( false);
                        RemoteInfo.Current.ReadMsgList (false);
                    }
                } else {
                    Console.WriteLine ("极光推送!!!");