From a3dfbcd5218270f9a75e6e32807b08215270b657 Mon Sep 17 00:00:00 2001 From: wxr <wxr@hdlchina.com.cn> Date: 星期三, 11 九月 2024 11:48:23 +0800 Subject: [PATCH] Merge branch 'feature/v2.5_极光推送' into feature/V2.6.0_google --- HDL-ON_Android/Other/JPush/JPushReceiver.cs | 62 +++++++++++++++++++------------ 1 files changed, 38 insertions(+), 24 deletions(-) diff --git a/HDL-ON_Android/Other/JPush/JPushReceiver.cs b/HDL-ON_Android/Other/JPush/JPushReceiver.cs index fdd0833..3261a1a 100644 --- a/HDL-ON_Android/Other/JPush/JPushReceiver.cs +++ b/HDL-ON_Android/Other/JPush/JPushReceiver.cs @@ -1,31 +1,50 @@ 锘� using System; -using Android.App; 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; -using Android.OS; namespace HDL_ON_Android { - [BroadcastReceiver(Enabled = true, Exported = false)] - [Android.App.IntentFilter(new string[] - { - "cn.jpush.android.intent.RECEIVE_MESSAGE" - }, - Categories = new string[] - { - "com.hdl.onpro" - })] - public class JPushReceiver : JPushMessageReceiver + //[BroadcastReceiver(Enabled = true, Exported = false)] + //[Android.App.IntentFilter(new string[] + //{ + // "cn.jpush.android.intent.RECEIVE_MESSAGE" + //}, + //Categories = new string[] + //{ + // "com.hdl.onpro" + //})] + + + //[Android.App.Service(Enabled = true)] + //[Android.App.IntentFilter( + // new string[] { "cn.jpush.android.intent.SERVICE_MESSAGE" }, + // Categories = new string[] + // { + // "com.hdl.onpro" + // })] + + [BroadcastReceiver(Enabled = true, Exported = true)] + [Android.App.IntentFilter(new string[] { "cn.jpush.android.intent.SERVICE_MESSAGE" }, Categories = new string[] { "com.hdl.onpro" })] + public class JPushReceiver : JPushMessageReceiver// JPushMessageService { private static string TAG = "JPushReceiver"; + + public override void OnMessage(Context p0, CustomMessage p1) + { + Console.WriteLine("鏀跺埌鏋佸厜鎺ㄩ��"); + base.OnMessage(p0, p1); + + } + /// <summary> /// 鐢ㄦ埛鐐瑰嚮鎵撳紑浜嗛�氱煡 /// 鐐瑰嚮閫氱煡鍥炶皟 @@ -35,7 +54,7 @@ public override void OnNotifyMessageOpened(Context context, NotificationMessage notificationMessage) { - + //2020-12-23 瑙e喅鐐瑰嚮閫氱煡鏍忔墦寮�涓嶄簡APP闂 //base.OnNotifyMessageOpened(context, notificationMessage); OpenNotification(context, notificationMessage); @@ -49,7 +68,7 @@ public override void OnNotifyMessageArrived(Context context, NotificationMessage notificationMessage) { base.OnNotifyMessageArrived(context, notificationMessage); - + var pushMes = new JPushMessageInfo() { Title = notificationMessage.NotificationTitle, @@ -63,14 +82,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); @@ -115,7 +130,6 @@ public override void OnRegister(Context context, string p1) { base.OnRegister(context, p1); - Utlis.WriteLine("JPushOnRegister: " + p1); } /// <summary> @@ -148,15 +162,15 @@ Utlis.WriteLine("PushMes extras : " + pushMes.Extras); Utlis.WriteLine("PushMes HomeId : " + pushMes.HomeId); - if (Shared.Application.Activity==null) + if (Shared.Application.Activity == null) { - Intent i = new Intent(context, typeof(SplashActivity));//Intent intent=new Intent( 璧峰缁勪欢瀵硅薄 , 鐩爣 Service.class); + Intent i = new Intent(context, typeof(SplashActivity)); i.SetFlags(ActivityFlags.NewTask); context.StartActivity(i); } else { - Intent i = new Intent(context, typeof(BaseActivity));//Intent intent=new Intent( 璧峰缁勪欢瀵硅薄 , 鐩爣 Service.class); + Intent i = new Intent(context, typeof(BaseActivity)); i.SetFlags(ActivityFlags.NewTask); context.StartActivity(i); } -- Gitblit v1.8.0