From 157be5220d9d81bce18e8248ef6ac056415405a1 Mon Sep 17 00:00:00 2001
From: Tong <1025782220@qq.com>
Date: 星期二, 31 八月 2021 09:29:45 +0800
Subject: [PATCH] 更新推送库

---
 HDL-ON_Android/Other/JPush/JPushFirmBroadcast.cs     |   40 +++++++++++++
 HDL-ON_Android/Other/JPush/JPushOpenClickActivity.cs |   58 +++++++++++++++++++
 HDL-ON_Android/Application.cs                        |    4 
 HDL-ON_Android/Assets/agconnect-services.json        |   47 +++++++++++++++
 4 files changed, 147 insertions(+), 2 deletions(-)

diff --git a/HDL-ON_Android/Application.cs b/HDL-ON_Android/Application.cs
index ecb3682..7a4f0db 100644
--- a/HDL-ON_Android/Application.cs
+++ b/HDL-ON_Android/Application.cs
@@ -226,9 +226,9 @@
         {
             //鎵嬫満鍚嶇О Android.OS.Build.Manufacturer;
             //OnAppConfig.Instance.PhoneName = Android.OS.Build.Manufacturer;
-//#if DEBUG
+            //#if DEBUG
             //CN.Jpush.Android.Api.JPushInterface.SetDebugMode(true);
-//#endif
+            //#endif
             CN.Jpush.Android.Api.JPushInterface.Init(this);
 
         }
diff --git a/HDL-ON_Android/Assets/agconnect-services.json b/HDL-ON_Android/Assets/agconnect-services.json
new file mode 100644
index 0000000..466ec39
--- /dev/null
+++ b/HDL-ON_Android/Assets/agconnect-services.json
@@ -0,0 +1,47 @@
+{
+	"agcgw_all":{
+		"CN":"connect-drcn.hispace.hicloud.com",
+		"CN_back":"connect-drcn.dbankcloud.cn",
+		"DE":"connect-dre.hispace.hicloud.com",
+		"DE_back":"connect-dre.dbankcloud.cn",
+		"RU":"connect-drru.hispace.hicloud.com",
+		"RU_back":"connect-drru.dbankcloud.cn",
+		"SG":"connect-dra.hispace.hicloud.com",
+		"SG_back":"connect-dra.dbankcloud.cn"
+	},
+	"client":{
+		"cp_id":"2850086000428177029",
+		"product_id":"736430079245970940",
+		"client_id":"703480846752957504",
+		"client_secret":"6E796F2ED36C43A87C4F7BB68680F29A15CBD7635F1D55ED004A17F2D2070D17",
+		"project_id":"736430079245970940",
+		"app_id":"104676079",
+		"api_key":"CwEAAAAAzCMOmemAwFVmnLqO8YeBY1StA3YLbXD5k/jRfW8xIga0hN85Ka9PQ4R9hj7dn0WtjVkoW9rTgusFrJhAxUE4tMGV514=",
+		"package_name":"com.hdl.onpro"
+	},
+	"oauth_client":{
+		"client_id":"104676079",
+		"client_type":1
+	},
+	"app_info":{
+		"app_id":"104676079",
+		"package_name":"com.hdl.onpro"
+	},
+	"configuration_version":"3.0",
+	"appInfos":[
+		{
+			"package_name":"com.hdl.onpro",
+			"client":{
+				"app_id":"104676079"
+			},
+			"app_info":{
+				"package_name":"com.hdl.onpro",
+				"app_id":"104676079"
+			},
+			"oauth_client":{
+				"client_type":1,
+				"client_id":"104676079"
+			}
+		}
+	]
+}
\ No newline at end of file
diff --git a/HDL-ON_Android/Other/JPush/JPushFirmBroadcast.cs b/HDL-ON_Android/Other/JPush/JPushFirmBroadcast.cs
new file mode 100644
index 0000000..dcf1789
--- /dev/null
+++ b/HDL-ON_Android/Other/JPush/JPushFirmBroadcast.cs
@@ -0,0 +1,40 @@
+锘縰sing Android.App;
+using Android.Content;
+using Android.OS;
+using Android.Runtime;
+using Android.Views;
+using Android.Widget;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace JPushSample
+{
+
+    [BroadcastReceiver(Enabled = true, Exported = false, Name = "com.hdl.onpro.JPushFirmBroadcast")]
+    [Android.App.IntentFilter(new string[]
+    {
+        "com.hdl.onpro.jpush.firm.NOTIFICATION_OPENED"
+    },
+     Categories = new string[]
+    {
+        Intent.CategoryDefault
+    })]
+    class JPushFirmBroadcast : BroadcastReceiver
+    {
+
+
+        public override void OnReceive(Context context, Intent intent)
+        {
+
+            /* 鐢ㄦ潵鎺ユ敹鍘傚晢鐐瑰嚮閫氱煡娑堟伅锛岄渶瑕佹墦寮�MainActivity 闇�瑕佽嚜琛岃皟鐢�
+             cn.jpush.android.EXTRA,cn.jpush.android.MSG_ID,
+             cn.jpush.android.TYPE_PLATFORM,
+            cn.jpush.android.TITLE,
+            cn.jpush.android.MESSAGE*/
+
+
+        }
+    }
+}
\ No newline at end of file
diff --git a/HDL-ON_Android/Other/JPush/JPushOpenClickActivity.cs b/HDL-ON_Android/Other/JPush/JPushOpenClickActivity.cs
new file mode 100644
index 0000000..31b9aca
--- /dev/null
+++ b/HDL-ON_Android/Other/JPush/JPushOpenClickActivity.cs
@@ -0,0 +1,58 @@
+锘縰sing Android.App;
+using Android.Content;
+using Android.OS;
+using Android.Runtime;
+using Android.Views;
+using Android.Widget;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Com.Hdl.ON.Jpush.Androidjpush;
+
+namespace JPushSample
+{
+    [Activity(LaunchMode = Android.Content.PM.LaunchMode.SingleTop,
+            Exported = true, Enabled = true, Name = "com.hdl.onpro.JPushOpenClickActivity")]
+    [IntentFilter(new string[] { "com.hdl.onpro.JPushOpenClickActivity", Intent.ActionView },
+         Categories = new string[]
+        {
+      "com.hdl.onpro",Intent.CategoryDefault
+        })
+        ]
+    public class JPushOpenClickActivity : Activity
+    {
+
+
+        protected override void OnCreate(Bundle savedInstanceState)
+        {
+            base.OnCreate(savedInstanceState);
+
+        }
+
+        protected void HandleOpenClick()
+        {
+            Intent intent = new Intent();
+            intent.SetAction("com.hdl.onpro.jpush.firm.NOTIFICATION_OPENED");
+            ComponentName componentName = new ComponentName(PackageName, "com.hdl.onpro.JPushFirmBroadcast");
+
+            if (Build.VERSION.SdkInt >= BuildVersionCodes.O)
+            {
+                intent.SetComponent(componentName);
+            }
+
+
+            this.SendBroadcast(intent);
+            FirmOpenClickHelper.Instance.HandleOpenClick(this, Intent, intent);
+            Finish();
+        }
+
+        protected override void OnNewIntent(Intent intent)
+        {
+            base.OnNewIntent(intent);
+            Intent = intent;
+            HandleOpenClick();
+
+        }
+    }
+}
\ No newline at end of file

--
Gitblit v1.8.0