| | |
| | | // try |
| | | // { |
| | | // System.Threading.Thread.Sleep(200); |
| | | // //if (!MainPage.LoginUser.IsLogin) { |
| | | // //if (! UserInfo.Current.IsLogin) { |
| | | // // continue; |
| | | // //} |
| | | // if (!CommonPage.IsRemote) continue; |
| | |
| | | |
| | | // var topicFilterPush2 = new TopicFilter |
| | | // { |
| | | // Topic = $"/BusGateWayToClient/{MainPage.LoginUser.ID}" + PushNotifySqueeze, |
| | | // Topic = $"/BusGateWayToClient/{ UserInfo.Current.ID}" + PushNotifySqueeze, |
| | | // QualityOfServiceLevel = MQTTnet.Protocol.MqttQualityOfServiceLevel.AtMostOnce, |
| | | // //QualityOfServiceLevel = MQTTnet.Protocol.MqttQualityOfServiceLevel.ExactlyOnce |
| | | // }; |
| | |
| | | // return; |
| | | // } |
| | | |
| | | // if (!MainPage.LoginUser.IsLogin) |
| | | // if (! UserInfo.Current.IsLogin) |
| | | // { |
| | | // return; |
| | | // } |
| | |
| | | // // ReceiveNotifySqueezeAsync (mMes); |
| | | // //} else |
| | | |
| | | // if (topic == $"/BusGateWayToClient/{MainPage.LoginUser.ID}" + PushNotifySqueeze) |
| | | // if (topic == $"/BusGateWayToClient/{ UserInfo.Current.ID}" + PushNotifySqueeze) |
| | | // { |
| | | // var mMes = System.Text.Encoding.UTF8.GetString(e.ApplicationMessage.Payload); |
| | | // //新挤下线主题方案 收到挤下线主题 |
| | |
| | | // var username = MqttInfoConfig.Instance.mMqttInfo.connEmqUserName; |
| | | // var passwordRemote = MqttInfoConfig.Instance.mMqttInfo.connEmqPwd; |
| | | // MqttInfoConfig.Instance.CurRemoteMACInfo.clientId = clientId; |
| | | // //MqttInfoConfig.Instance.CurRemoteMACInfo.LoginAccessToken = MainPage.LoginUser.LoginTokenString; |
| | | // //MqttInfoConfig.Instance.CurRemoteMACInfo.LoginAccessToken = UserInfo.Current.LoginTokenString; |
| | | // //获取参数成功,保存到本地并标记为true |
| | | |
| | | // MqttInfoConfig.Instance.IfGetMqttInfoSuccess = true; |
| | |
| | | |
| | | // //断开远程连接 |
| | | // CommonPage.IsRemote = false; |
| | | // if (!MainPage.LoginUser.IsLogin) |
| | | // if (! UserInfo.Current.IsLogin) |
| | | // { |
| | | // return; |
| | | // } |
| | | |
| | | // DisConnectRemoteMqttClient("挤下线"); |
| | | |
| | | // MainPage.LoginUser.LastTime = DateTime.MinValue; |
| | | // MainPage.LoginUser.SaveUserInfo(); |
| | | // UserInfo.Current.LastTime = DateTime.MinValue; |
| | | // UserInfo.Current.SaveUserInfo(); |
| | | // Room.Lists.Clear(); |
| | | // ////删除推送数据 |
| | | // //var webclient = new System.Net.WebClient (); |
| | | // //webclient.Headers.Add (System.Net.HttpRequestHeader.Authorization, MainPage.LoginUser.LoginTokenString); |
| | | // //webclient.Headers.Add (System.Net.HttpRequestHeader.Authorization, UserInfo.Current.LoginTokenString); |
| | | // //webclient.DownloadStringAsync (new Uri ("https://global.hdlcontrol.com/HangZhouHdlCloudApi/ZigbeeUsers/SignOut")); |
| | | |
| | | |
| | |
| | | // Application.RunOnMainThread(() => |
| | | // { |
| | | // Utlis.ShowAppLinkStatus(AppLinkStatus.WiFi); |
| | | // new Shared.SimpleControl.Phone.AccountLogin(MainPage.LoginUser.AccountString, "").Show(); |
| | | // new Shared.SimpleControl.Phone.AccountLogin( UserInfo.Current.AccountString, "").Show(); |
| | | // SharedMethod.SharedMethod.CurPageLayout = null; |
| | | // //CommonPage.IsRemote = false; |
| | | |
| | |
| | | // //2020-06-30 删除推送数据 |
| | | // ForceUpdateUtlis.Current.SignOut(); |
| | | //#if HDL |
| | | // if (!String.IsNullOrEmpty (MainPage.LoginUser.AllVisionRegisterDevUserNameGuid)) { |
| | | // if (!String.IsNullOrEmpty ( UserInfo.Current.AllVisionRegisterDevUserNameGuid)) { |
| | | // com.freeview.global.Video.Logout (); |
| | | // }///BusGateWayToClient/320c1fea-1866-4708-8277-e2321a4dd236/NotifyGateWayInfoChange |
| | | //#endif |
| | |
| | | // await RemoteMqttClient.PublishAsync(new MqttApplicationMessage { Topic = topicName, Retain = false, QualityOfServiceLevel = MQTTnet.Protocol.MqttQualityOfServiceLevel.AtMostOnce }); |
| | | // break; |
| | | // case 4://发布新方案的挤下线主题 |
| | | // topicName = $"/BusGateWayToClient/{MainPage.LoginUser.ID}" + PushNotifySqueeze; |
| | | // topicName = $"/BusGateWayToClient/{ UserInfo.Current.ID}" + PushNotifySqueeze; |
| | | // //message = System.Text.Encoding.UTF8.GetBytes (PushSignStr); |
| | | // await RemoteMqttClient.PublishAsync(new MqttApplicationMessage { Topic = topicName, Payload = message, Retain = false, QualityOfServiceLevel = MQTTnet.Protocol.MqttQualityOfServiceLevel.AtMostOnce }); |
| | | // break; |
| | |
| | | // { |
| | | // var mqttInfoRequestPar = new GetConnMqttInfoObj() |
| | | // { |
| | | // LoginAccessToken = MainPage.LoginUser.LoginTokenString, |
| | | // LoginAccessToken = UserInfo.Current.LoginTokenString, |
| | | // PlatformStr = GetRandomKey(), |
| | | // PublishPayloadJsonStr = PushSignStr, |
| | | // Mac = UserConfig.Instance.GatewayMAC, |
| | |
| | | // MqttInfoConfig.Instance.CurRemoteMACInfo = mqttInfoRequestResult_Obj.AccountAllGateways.Find((obj) => obj.mac == UserConfig.Instance.GatewayMAC); |
| | | // if (MqttInfoConfig.Instance.CurRemoteMACInfo != null) |
| | | // { |
| | | // //MqttInfoConfig.Instance.CurRemoteMACInfo.LoginAccessToken = MainPage.LoginUser.LoginTokenString; |
| | | // //MqttInfoConfig.Instance.CurRemoteMACInfo.LoginAccessToken = UserInfo.Current.LoginTokenString; |
| | | // MqttInfoConfig.Instance.CurRemoteMACInfo.clientId = clientId; |
| | | // //----第三步 开始连接 |
| | | // await MQTTConnectAsync(); |