From 071085275e07d96eda7f970f158482f0d9a8d4bf Mon Sep 17 00:00:00 2001 From: Tong <1025782220@qq.com> Date: 星期三, 01 九月 2021 13:33:32 +0800 Subject: [PATCH] 极光库整合完成 --- HDL-ON_Android/Other/JPush/JPushOpenClickActivity.cs | 37 +++++++++++++++++-------------------- 1 files changed, 17 insertions(+), 20 deletions(-) diff --git a/HDL-ON_Android/Other/JPush/JPushOpenClickActivity.cs b/HDL-ON_Android/Other/JPush/JPushOpenClickActivity.cs index 31b9aca..8fd8f2e 100644 --- a/HDL-ON_Android/Other/JPush/JPushOpenClickActivity.cs +++ b/HDL-ON_Android/Other/JPush/JPushOpenClickActivity.cs @@ -1,19 +1,16 @@ 锘縰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 +using Android.Views; + +namespace HDL_ON_Android { - [Activity(LaunchMode = Android.Content.PM.LaunchMode.SingleTop, - Exported = true, Enabled = true, Name = "com.hdl.onpro.JPushOpenClickActivity")] + [Activity( + Exported = true, Enabled = true, Name = "com.hdl.onpro.JPushOpenClickActivity" + , Theme = "@android:style/Theme.Translucent.NoTitleBar", TaskAffinity = ":jpushopenclick")] [IntentFilter(new string[] { "com.hdl.onpro.JPushOpenClickActivity", Intent.ActionView }, Categories = new string[] { @@ -27,31 +24,31 @@ protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); + View v = new View(this); + SetContentView(v); + HandleOpenClick(Intent); } - protected void HandleOpenClick() + protected void HandleOpenClick(Intent intent) { - Intent intent = new Intent(); - intent.SetAction("com.hdl.onpro.jpush.firm.NOTIFICATION_OPENED"); + Intent broadcastIntent = new Intent(); + broadcastIntent.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); + broadcastIntent.SetComponent(componentName); } - - - this.SendBroadcast(intent); - FirmOpenClickHelper.Instance.HandleOpenClick(this, Intent, intent); + FirmOpenClickHelper.Instance.HandleOpenClick(this, intent, broadcastIntent); Finish(); + } protected override void OnNewIntent(Intent intent) { base.OnNewIntent(intent); - Intent = intent; - HandleOpenClick(); + HandleOpenClick(intent); } } -- Gitblit v1.8.0