From 81320dd623221ba49fb6e9184a2b184bd4049c7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E5=A4=A7=E5=BE=B7?= Date: Fri, 28 Jul 2023 22:30:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E8=8E=B7=E5=8F=96=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E5=87=BA=E9=94=99=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin.xml | 2 +- src/android/TpnsReceiver.java | 42 ++++++++++++++++++++++++++++++++++- src/android/build-tpns.gradle | 21 ++++++++++-------- 3 files changed, 54 insertions(+), 11 deletions(-) diff --git a/plugin.xml b/plugin.xml index 2a5667d..91ddf31 100644 --- a/plugin.xml +++ b/plugin.xml @@ -12,7 +12,7 @@ - + diff --git a/src/android/TpnsReceiver.java b/src/android/TpnsReceiver.java index 5ee7d3e..050548c 100644 --- a/src/android/TpnsReceiver.java +++ b/src/android/TpnsReceiver.java @@ -17,7 +17,7 @@ import com.tencent.android.tpush.XGPushTextMessage; import org.json.JSONException; import org.json.JSONObject; -public abstract class TpnsReceiver extends XGPushBaseReceiver { +public class TpnsReceiver extends XGPushBaseReceiver { private static final String TAG = TpnsPlugin.class.getSimpleName(); /** @@ -110,6 +110,41 @@ public abstract class TpnsReceiver extends XGPushBaseReceiver { Log.d(TAG, "广播接收到通知:" + text); } + @Override + public void onRegisterResult(Context context, int i, XGPushRegisterResult xgPushRegisterResult) { + + } + + @Override + public void onUnregisterResult(Context context, int i) { + + } + + @Override + public void onSetTagResult(Context context, int i, String s) { + + } + + @Override + public void onDeleteTagResult(Context context, int i, String s) { + + } + + @Override + public void onSetAccountResult(Context context, int i, String s) { + + } + + @Override + public void onDeleteAccountResult(Context context, int i, String s) { + + } + + @Override + public void onSetAttributeResult(Context context, int i, String s) { + + } + @Override public void onQueryTagsResult(Context context, int errorCode, String data, String operateName) { Log.i(TAG, "action - onQueryTagsResult, errorCode:" + errorCode + ", operateName:" + operateName + ", data: " + data); @@ -122,4 +157,9 @@ public abstract class TpnsReceiver extends XGPushBaseReceiver { }); } + + @Override + public void onDeleteAttributeResult(Context context, int i, String s) { + + } } diff --git a/src/android/build-tpns.gradle b/src/android/build-tpns.gradle index 7416ea6..ae2bf08 100644 --- a/src/android/build-tpns.gradle +++ b/src/android/build-tpns.gradle @@ -10,10 +10,12 @@ def getConfigPreference(name) { if (attrName && attrName.toLowerCase() == "tpnsplugin") { it.param.each { p -> def pName = p.attribute("name") - if (p.attribute('default') != null) { - defaultValue = p.attribute('default'); - } else { - ret = p.attribute("value") + if(pName && pName.toLowerCase() == name){ + if (p.attribute('default') != null) { + defaultValue = p.attribute('default'); + } else { + ret = p.attribute("value") + } } } @@ -29,14 +31,14 @@ android { abiFilters 'armeabi', 'armeabi-v7a', 'arm64-v8a' } manifestPlaceholders = [ - XG_ACCESS_ID : getConfigPreference("XG_ACCESS_ID"), - XG_ACCESS_KEY : getConfigPreference("XG_ACCESS_KEY"), + XG_ACCESS_ID : getConfigPreference("XG_ACCESS_ID"), + XG_ACCESS_KEY : getConfigPreference("XG_ACCESS_KEY"), ] } } dependencies { - //添加以下依赖 - implementation 'com.tencent.tpns:tpns:1.4.0.1-release' + //添加以下依赖 + implementation 'com.tencent.tpns:tpns:1.4.0.1-release' // TPNS 推送 [VERSION] 为最新 SDK 版本号,即为上述步骤2获取的版本号 //implementation 'com.tencent.tpns:honor:1.4.0.1-release' //荣耀 implementation 'com.tencent.tpns:meizu:1.4.0.1-release' //魅族 @@ -50,4 +52,5 @@ dependencies { implementation 'commons-codec:commons-codec:1.15' -} \ No newline at end of file +} + \ No newline at end of file