Tong
2021-08-31 157be5220d9d81bce18e8248ef6ac056415405a1
更新推送库
3个文件已添加
1个文件已修改
149 ■■■■■ 已修改文件
HDL-ON_Android/Application.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Assets/agconnect-services.json 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Other/JPush/JPushFirmBroadcast.cs 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Other/JPush/JPushOpenClickActivity.cs 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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);
        }
HDL-ON_Android/Assets/agconnect-services.json
New file
@@ -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"
            }
        }
    ]
}
HDL-ON_Android/Other/JPush/JPushFirmBroadcast.cs
New file
@@ -0,0 +1,40 @@
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;
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*/
        }
    }
}
HDL-ON_Android/Other/JPush/JPushOpenClickActivity.cs
New file
@@ -0,0 +1,58 @@
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();
        }
    }
}