From dc9a1b15bb69227e19afc070adf58156a362d2a2 Mon Sep 17 00:00:00 2001 From: wxr <wxr@hdlchina.com.cn> Date: 星期一, 30 九月 2024 17:07:58 +0800 Subject: [PATCH] 安卓可视对讲响铃, --- HDL-ON_Android/Other/JPush/JPushReceiver.cs | 25 ++++++++++++------------- 1 files changed, 12 insertions(+), 13 deletions(-) diff --git a/HDL-ON_Android/Other/JPush/JPushReceiver.cs b/HDL-ON_Android/Other/JPush/JPushReceiver.cs index 5ce75eb..d6404cf 100644 --- a/HDL-ON_Android/Other/JPush/JPushReceiver.cs +++ b/HDL-ON_Android/Other/JPush/JPushReceiver.cs @@ -3,6 +3,7 @@ using Android.Content; using CN.Jpush.Android.Api; using CN.Jpush.Android.Service; +using Com.Hdl.Hdllinphonesdk; using HDL_ON; using HDL_ON.DAL.Server; using Shared; @@ -52,11 +53,8 @@ /// <param name="notificationMessage"></param> public override void OnNotifyMessageOpened(Context context, NotificationMessage notificationMessage) { - - - //2020-12-23 瑙e喅鐐瑰嚮閫氱煡鏍忔墦寮�涓嶄簡APP闂 - //base.OnNotifyMessageOpened(context, notificationMessage); - OpenNotification(context, notificationMessage); + //MainPage.Log("鎺ユ敹鍒版帹閫�:鐐瑰嚮閫氱煡鍥炶皟"); + OpenNotification(context, notificationMessage,true); } /// <summary> @@ -81,14 +79,10 @@ pushMes.messageType = jpushExpandData.messageType; pushMes.expantContent = jpushExpandData.expantContent; pushMes.HomeId = jpushExpandData.homeId; - Utlis.WriteLine("PushMes messageType : " + pushMes.messageType); + Utlis.WriteLine("鏀跺埌閫氱煡鍥炶皟\r\nPushMes messageType : " + pushMes.messageType); } - if (!string.IsNullOrEmpty(pushMes.spk))//鑷爺鍙瀵硅闇�瑕佽褰曟椂闂村弽鍛� - { - UserInfo.Current.pushMessageInfo = pushMes; - UserInfo.Current.inCall = DateTime.Now; - } + Utlis.WriteLine("PushMes title : " + pushMes.Title); Utlis.WriteLine("PushMes message : " + pushMes.Content); @@ -140,15 +134,17 @@ /// </summary> /// <param name="context"></param> /// <param name="notificationMessage"></param> - public static void OpenNotification(Context context, NotificationMessage notificationMessage) + public static void OpenNotification(Context context, NotificationMessage notificationMessage,bool isNotification = false) { try { + //MainPage.Log("鎺ユ敹鍒版帹閫�:鎵撳紑娑堟伅鏄剧ず鐣岄潰"); var pushMes = new JPushMessageInfo() { Title = notificationMessage.NotificationTitle, Content = notificationMessage.NotificationContent, - Extras = notificationMessage.NotificationExtras + Extras = notificationMessage.NotificationExtras, + isNotificationGoing = isNotification }; var jpushExpandData = GetJPushExpandData(pushMes); @@ -174,11 +170,14 @@ else { Intent i = new Intent(context, typeof(BaseActivity)); + i.SetFlags(ActivityFlags.SingleTop); + i.SetFlags(ActivityFlags.ClearTop); i.SetFlags(ActivityFlags.NewTask); context.StartActivity(i); } //瑙f瀽msg AdjustPushMessage(pushMes); + } catch { -- Gitblit v1.8.0