using 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();
|
|
}
|
}
|
}
|