| | |
| | | OpenNotification(context, notificationMessage); |
| | | } |
| | | |
| | | static int msgId = 0; |
| | | |
| | | /// <summary> |
| | | /// 收到通知回调 |
| | | /// </summary> |
| | |
| | | /// <param name="p1"></param> |
| | | public override void OnNotifyMessageArrived(Context context, NotificationMessage notificationMessage) |
| | | { |
| | | base.OnNotifyMessageArrived(context, notificationMessage); |
| | | try |
| | | { |
| | | |
| | | NotificationManager nMgr = (NotificationManager)Shared.Application.Activity.GetSystemService(Context.NotificationService); |
| | | if (msgId != 0) |
| | | nMgr.Cancel(msgId); |
| | | msgId = notificationMessage.NotificationId; |
| | | base.OnNotifyMessageArrived(context, notificationMessage); Console.WriteLine("123456789ghjsdjfasdfk"); |
| | | |
| | | var pushMes = new JPushMessageInfo() |
| | | { |
| | |
| | | //UserInfo.Current.pushMesExpantContent = pushMes.expantContent;
|
| | | //UserInfo.Current.PushMesHomeId = pushMes.HomeId;
|
| | | UserInfo.Current.pushMessageInfo = pushMes;
|
| | | if (!string.IsNullOrEmpty(pushMes.spk))//自研可视对讲需要记录时间反呼 |
| | | UserInfo.Current.inCall = DateTime.Now;
|
| | |
|
| | | if (!MainPage.IsEnterBackground) |
| | | { |
| | | //NotificationManager nMgr = (NotificationManager)Shared.Application.Activity.GetSystemService(Context.NotificationService); |
| | | //nMgr.CancelAll(); |
| | | Shared.Application.RunOnMainThread(() => |
| | | { |
| | | HDLCommon.Current.AdjustPushMessage(pushMes); |
| | | }); |
| | | if (!MainPage.IsEnterBackground) |
| | | { |
| | | NotificationManager nMgr = (NotificationManager)Shared.Application.Activity.GetSystemService(Context.NotificationService); |
| | | nMgr.CancelAll(); |
| | | } |
| | | } |
| | | catch (Exception wexx) { |
| | | Console.WriteLine("safsdf"+wexx.Message); |
| | | } |
| | | }
|
| | |
|
| | |
| | | // HDLCommon.Current.AdjustPushMessage(pushMes);
|
| | | // }
|
| | | //});
|
| | | if (!MainPage.IsEnterBackground) |
| | | { |
| | | NotificationManager nMgr = (NotificationManager)Shared.Application.Activity.GetSystemService(Context.NotificationService); |
| | | nMgr.CancelAll(); |
| | | }
|
| | | } |
| | | catch |
| | | { |