| | |
| | | { |
| | | try |
| | | { |
| | | MainPage.Log($"接收到推送.\r\n{Newtonsoft.Json.JsonConvert.SerializeObject(jpushMessageInfo).ToString()}"); |
| | | //Console.WriteLine($"接收到推送,,,,.{Newtonsoft.Json.JsonConvert.SerializeObject(jpushMessageInfo).ToString()}"); |
| | | |
| | | //Extras为空不处理 |
| | | if (string.IsNullOrEmpty(jpushMessageInfo.Extras)) return; |
| | |
| | | |
| | | //字段兼容问题,只能直接取值了 |
| | | var json = Newtonsoft.Json.Linq.JObject.Parse(jpushMessageInfo.expantContent); |
| | | try |
| | | { |
| | | //var pushHomeId = json["homeId"]; |
| | | //if (pushHomeId == null || string.IsNullOrEmpty(pushHomeId.ToString())){ |
| | | // Console.WriteLine("homeId is null"); |
| | | // return; |
| | | //} |
| | | var pushTime = json["pushTime"]; |
| | | if(pushTime == null) |
| | | { |
| | | return; |
| | | } |
| | | if (!string.IsNullOrEmpty(pushTime.ToString())) |
| | | { |
| | | var pushDateTime = Utlis.UnixToDateTimeMS(Convert.ToInt64(pushTime)); |
| | | if (pushDateTime.AddSeconds(30) < DateTime.Now) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | catch { } |
| | | |
| | | |
| | | //1.视对讲厂家类型 |
| | | string interphoneTypeEnum = json["interphoneTypeEnum"].ToString(); |
| | |
| | | //萤石猫眼 |
| | | eSVideoInfo.Lc_AccessToken = json["subToken"].ToString();//"子账号token |
| | | eSVideoInfo.DeviceSerial = json["devSerial"].ToString();//设备序列号 |
| | | eSVideoInfo.Lc_DeviceId = json["deviceId"].ToString(); |
| | | eSVideoInfo.spk = json["spk"].ToString(); |
| | | |
| | | eSVideoInfo.HomeId = jpushMessageInfo.HomeId; |
| | | if (json.ContainsKey("msgId") && !string.IsNullOrEmpty(json["msgId"].ToString())) |
| | | { |
| | | eSVideoInfo.msgId = json["msgId"].ToString(); |
| | | } |
| | | if (json.ContainsKey("currentTime") && !string.IsNullOrEmpty(json["currentTime"].ToString())) |
| | | { |
| | | eSVideoInfo.currentTime = json["currentTime"].ToString(); |
| | | } |
| | | } |
| | | else if (interphoneTypeEnum == InterphoneType.HDL.ToString()) |
| | | { |
| | | try |
| | | { |
| | | var pushTime = json["pushTime"]; |
| | | if (pushTime == null) |
| | | { |
| | | return; |
| | | } |
| | | if (!string.IsNullOrEmpty(pushTime.ToString())) |
| | | { |
| | | var pushDateTime = Utlis.UnixToDateTimeMS(Convert.ToInt64(pushTime)); |
| | | if (pushDateTime.AddSeconds(30) < DateTime.Now) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | catch { } |
| | | //HDL Linphone 狄耐克 |
| | | eSVideoInfo.HomeId = jpushMessageInfo.HomeId; |
| | | eSVideoInfo.callId = json["callId"].ToString(); |
| | |
| | | case "13580507523": |
| | | case "15626203746": |
| | | case "18316672920": |
| | | |
| | | return; |
| | | } |
| | | |
| | |
| | | if (internetStatus == 0)//没有网络连接 0 |
| | | { |
| | | MainPage.InternetStatus = 0; |
| | | DAL.Mqtt.MqttClient.InitState(); |
| | | //DAL.Mqtt.MqttClient.DisConnectRemote();//.InitState(); |
| | | } |
| | | else if (internetStatus == 1)//3,4G的网络连接 1 |
| | | { |
| | |
| | | ((BaseActivity)Shared.Application.Activity).SetPermission(result => |
| | | { |
| | | //2023年03月29日13:08:35 修改 |
| | | Com.Videogo.Hdl.HDLEzvizSdk.Instance.Init(Application.Activity.Application, ezChildAccessToken, UserInfo.Current.LoginTokenString, UserInfo.Current.RefreshToken, OnAppConfig.Instance.RequestHttpsHost, "1aa98a90489b4838b966b57018b4b04b", 1, DB_ResidenceData.Instance.CurrentRegion.id); |
| | | Com.Videogo.Hdl.HDLEzvizSdk.Instance.Init(Application.Activity.Application, ezChildAccessToken, UserInfo.Current.LoginTokenString, UserInfo.Current.RefreshToken, OnAppConfig.Instance.RequestHttpsHost, "1aa98a90489b4838b966b57018b4b04b", 1, DB_ResidenceData.Instance.CurrentRegion.id, |
| | | HttpUtil.APP_KEY, HttpUtil.SECRET_KEY); |
| | | Com.Videogo.Hdl.HDLEzvizSdk.Instance.JumpToCameraListActivity(Shared.Application.Activity, list); |
| | | //if (result) |
| | | //{ |
| | |
| | | } |
| | | else |
| | | { |
| | | IMessageCommon.Current.ShowErrorInfoAlter(result.Code); |
| | | if (result.Code != "-1") |
| | | IMessageCommon.Current.ShowErrorInfoAlter(result.Code); |
| | | } |
| | | } |
| | | catch (Exception ex) |