| | |
| | | #region ■ 推送处理_______________________ |
| | | /// <summary> |
| | | /// 推送消息处理 |
| | | /// 注意:Android要在主线程(UI线程)执行 |
| | | /// </summary> |
| | | /// <param name="jpushMessageInfo"></param> |
| | | public void AdjustPushMessage(JPushMessageInfo jpushMessageInfo) |
| | | { |
| | | try |
| | | { |
| | | if (jpushMessageInfo.Extras != null && jpushMessageInfo.Extras.Contains("OffLine")) |
| | | { |
| | | Shared.Application.RunOnMainThread(() => |
| | | { |
| | | ////账号在别处登陆,被踢下线 跳转到登录页面 |
| | | //new Alert(Language.StringByID(StringId.Tip), Language.StringByID(StringId.LoggedOnOtherDevices), Language.StringByID(StringId.Close)).Show(); |
| | | //退出登录操作 |
| | | CheckLogout(); |
| | | //Extras为空不处理 |
| | | if (string.IsNullOrEmpty(jpushMessageInfo.Extras)) return; |
| | | |
| | | }); |
| | | return; |
| | | if (jpushMessageInfo.Extras.Contains(PushMessageType.OffLine.ToString())) |
| | | { |
| | | CheckLogout(); |
| | | } |
| | | else |
| | | { |
| | | Shared.Application.RunOnMainThread(() => |
| | | GetPushMessageAction?.Invoke(); |
| | | |
| | | //messageType为空不处理 |
| | | if (string.IsNullOrEmpty(jpushMessageInfo.messageType)) return; |
| | | |
| | | //报警推送才弹窗提示(messageType包含Alarm关键字的) |
| | | if (jpushMessageInfo.messageType.Contains(PushMessageType.Alarm.ToString())) |
| | | { |
| | | GetPushMessageAction?.Invoke(); |
| | | //报警推送才弹窗提示(messageType包含Alarm关键字的) |
| | | if (jpushMessageInfo.messageType != null && jpushMessageInfo.messageType.Contains("Alarm")) |
| | | //报警推送弹窗提示 |
| | | ShowAlarmPushMessage(jpushMessageInfo); |
| | | } |
| | | else if (jpushMessageInfo.messageType.Contains(PushMessageType.FLCall.ToString())) |
| | | { |
| | | if (string.IsNullOrEmpty(jpushMessageInfo.expantContent)) return; |
| | | |
| | | ESVideoInfo eSVideoInfo = GetESOnVideoJson(jpushMessageInfo.expantContent); |
| | | |
| | | if (eSVideoInfo == null) return; |
| | | |
| | | if (string.IsNullOrEmpty(eSVideoInfo.uuid)) return; |
| | | |
| | | if (eSVideoInfo.uuid.Contains(",")) |
| | | { |
| | | //报警推送弹窗提示 |
| | | ShowAlarmPushMessage(jpushMessageInfo); |
| | | //new Alert(jpushMessageInfo.Title, jpushMessageInfo.Content, Language.StringByID(StringId.Close)).Show(); |
| | | var uuid = eSVideoInfo.uuid.Split(','); |
| | | eSVideoInfo.ESVideoUUID = uuid[0]; |
| | | } |
| | | else |
| | | { |
| | | eSVideoInfo.ESVideoUUID = eSVideoInfo.uuid; |
| | | } |
| | | |
| | | }); |
| | | return; |
| | | ESOnVideo.Current.ShowESvideoVideoIntercom(eSVideoInfo); |
| | | |
| | | } |
| | | } |
| | | } |
| | | catch(Exception EX) |
| | | { |
| | | Utlis.WriteLine("catch: " + EX.ToString()); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="jsonStr"></param> |
| | | /// <returns></returns> |
| | | ESVideoInfo GetESOnVideoJson(string jsonStr) |
| | | { |
| | | try |
| | | { |
| | | if (!string.IsNullOrEmpty(jsonStr)) |
| | | { |
| | | return Newtonsoft.Json.JsonConvert.DeserializeObject<ESVideoInfo>(jsonStr); |
| | | } |
| | | return null; |
| | | } |
| | | catch |
| | | { |
| | | |
| | | return null; |
| | | } |
| | | } |
| | | |