This commit is contained in:
jia 2024-12-30 22:33:42 +08:00
parent c918fccbc8
commit db2396b7dc
4 changed files with 115 additions and 44 deletions

View File

@ -22,7 +22,7 @@ android {
}
signingConfigs {
debug {
config {
keyAlias 'android.keystore'
keyPassword 'ifish7'
storeFile file('../ifish7.keystore')
@ -81,10 +81,11 @@ android {
buildTypes {
debug {
minifyEnabled false
signingConfig signingConfigs.debug
signingConfig signingConfigs.config
}
release {
minifyEnabled false
signingConfig signingConfigs.config
}
}
dexOptions {
@ -172,20 +173,11 @@ dependencies {
implementation 'com.getui.opt:honor:3.6.0' // 耀
//
implementation 'com.huawei.hms:push:6.12.0.300'
// 耀 SDK
implementation 'com.hihonor.mcs:push:7.0.61.303'
//
// //
// implementation 'com.getui.opt:hwp:3.1.2' //
// implementation 'com.getui.opt:xmp:3.3.1' //
// implementation 'com.assist-v3:oppo:3.5.0' // oppo
// implementation 'com.assist-v3:vivo:3.2.0' // vivo
// implementation 'com.getui.opt:mzp:3.2.3' //
// implementation 'com.getui.opt:honor:3.6.0' // 耀
//oppo配置以下依赖都需要添加
// implementation 'com.google.code.gson:gson:2.6.2'
implementation 'commons-codec:commons-codec:1.6'
implementation 'com.android.support:support-annotations:28.0.0'
}

View File

@ -643,8 +643,19 @@
android:theme="@style/Transparent" />
<activity
android:name=".RecentContactsActivity"
android:exported="true"
android:launchMode="singleTop"
android:theme="@style/Transparent" />
android:theme="@style/Transparent">
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="com.getui.push"
android:path="/detail"
android:scheme="gtpushscheme" />
</intent-filter>
</activity>
<activity
android:name=".FishGoodsManagerActivity"
android:launchMode="singleTop"
@ -872,12 +883,12 @@
<!-- 请填写实际的类名,下面仅是示例代码 -->
<!-- <service android:name="com.ifish.utils.MyPushIntentService" android:process=":push"/> -->
<!-- taikingdata统计appkey -->
<meta-data
android:name="TD_APP_ID"
android:value="351E6F7956CEF7FB6AABAEB64EF9BF18" />
<meta-data
android:name="TD_CHANNEL_ID"
android:value="Your_channel_id" /> <!-- taikingdata统计appkey -->
<!-- <meta-data-->
<!-- android:name="TD_APP_ID"-->
<!-- android:value="351E6F7956CEF7FB6AABAEB64EF9BF18" />-->
<!-- <meta-data-->
<!-- android:name="TD_CHANNEL_ID"-->
<!-- android:value="Your_channel_id" /> &lt;!&ndash; taikingdata统计appkey &ndash;&gt;-->
<!--
&lt;!&ndash; 友盟微社区 &ndash;&gt;
&lt;!&ndash; feed主页面 &ndash;&gt;
@ -995,31 +1006,31 @@ android:configChanges="keyboardHidden|orientation|screenSize" />
</intent-filter>
</receiver> <!-- 配置APP KEY -->
<!-- 友盟微社区 -->
<meta-data
android:name="UMENG_APPKEY"
android:value="55f7d5bfe0f55a14770001da" /> <!-- 友盟推送 -->
<meta-data
android:name="UMENG_MESSAGE_SECRET"
android:value="de4784938fdb6302dcfcf8e5c2ebf15d" />
<meta-data
android:name="UMENG_CHANNEL"
android:value="Unknown" /> <!-- 高德定位 -->
<meta-data
android:name="com.amap.api.v2.apikey"
android:value="1a7ef0b4768ac0c95d6abf6e46b8f1d3" /> <!-- 网易云信 -->
<meta-data
android:name="com.netease.nim.appKey"
android:value="87b0e3315dfc2df08060bcb54246da68" /> <!-- 阿里推送 -->
<meta-data
android:name="com.alibaba.app.appkey"
android:value="26023230" /> <!-- 请填写你自己的- appKey -->
<meta-data
android:name="com.alibaba.app.appsecret"
android:value="03f24e29af6eccb121e516bedbcabf7f" /> <!-- 请填写你自己的appSecret -->
<!-- <meta-data-->
<!-- android:name="UMENG_APPKEY"-->
<!-- android:value="55f7d5bfe0f55a14770001da" /> &lt;!&ndash; 友盟推送 &ndash;&gt;-->
<!-- <meta-data-->
<!-- android:name="UMENG_MESSAGE_SECRET"-->
<!-- android:value="de4784938fdb6302dcfcf8e5c2ebf15d" />-->
<!-- <meta-data-->
<!-- android:name="UMENG_CHANNEL"-->
<!-- android:value="Unknown" /> &lt;!&ndash; 高德定位 &ndash;&gt;-->
<!-- <meta-data-->
<!-- android:name="com.amap.api.v2.apikey"-->
<!-- android:value="1a7ef0b4768ac0c95d6abf6e46b8f1d3" /> &lt;!&ndash; 网易云信 &ndash;&gt;-->
<!-- <meta-data-->
<!-- android:name="com.netease.nim.appKey"-->
<!-- android:value="87b0e3315dfc2df08060bcb54246da68" /> &lt;!&ndash; 阿里推送 &ndash;&gt;-->
<!-- <meta-data-->
<!-- android:name="com.alibaba.app.appkey"-->
<!-- android:value="26023230" /> &lt;!&ndash; 请填写你自己的- appKey &ndash;&gt;-->
<!-- <meta-data-->
<!-- android:name="com.alibaba.app.appsecret"-->
<!-- android:value="03f24e29af6eccb121e516bedbcabf7f" /> &lt;!&ndash; 请填写你自己的appSecret &ndash;&gt;-->
<!-- 在AndroidManifest.xml中配置AppID其中xxxxx为华为应用的AppID。 -->
<meta-data
android:name="com.huawei.hms.client.appid"
android:value="appid=xxxxxx" />
<!-- <meta-data-->
<!-- android:name="com.huawei.hms.client.appid"-->
<!-- android:value="appid=xxxxxx" />-->
</application>
</manifest>

View File

@ -27,6 +27,7 @@ import com.ifish.utils.AnimationUtil;
import com.ifish.utils.Commons;
import com.ifish.utils.HttpListener;
import com.ifish.utils.HttpManager;
import com.ifish.utils.L;
import com.ifish.utils.PushTypeEnum;
import com.ifish.utils.ToastUtil;
import com.ifish.utils.UnreadCount;
@ -34,14 +35,19 @@ import com.ifish.view.CustomSwipeRefreshLayout;
import com.ifish.view.MyCheckView;
import com.ifish.view.PopWindowDevice_EventBus;
import com.ifish.view.PopWindowPushDel;
import com.igexin.sdk.PushManager;
import com.squareup.picasso.Picasso;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.math.BigInteger;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import de.greenrobot.event.EventBus;
/**
@ -84,7 +90,65 @@ public class RecentContactsActivity extends BaseFragmentActivity implements Cust
initView();
initListener();
startData();
//获取自定义透传参数值
Intent intent = getIntent();
if (null != intent) {
String payload = intent.getStringExtra("payload");
L.i("payload = " + payload);
}
//上报华为oppovivo离线点击数据
pushClick(intent);
}
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
//获取自定义透传参数值
if (null != intent) {
String payload = intent.getStringExtra("payload");
L.i( "payload = " + payload);
}
}
/**
* 由于华为oppo 无点击数报表返回vivo无单推点击数报表返回所以需要您在客户端埋点上报
* 点击厂商通知以后在触发的activity的onCreate()方法里面接收相关参数上报这 3 个离线厂商消息的点击数据
* 开发者可直接使用此方法示例
*
* @param intent
* @return
*/
public boolean pushClick(Intent intent) {
boolean result = false;
try {
String taskid = intent.getStringExtra("gttask");
String gtaction = intent.getStringExtra("gtaction");
String clientid = PushManager.getInstance().getClientid(this);
String uuid = UUID.randomUUID().toString().replaceAll("-", "");
// 这里的messageid需要自定义 保证每条消息汇报的都不相同
String contentToDigest = taskid + clientid + uuid;
byte[] md5s = MessageDigest.getInstance("MD5").digest(contentToDigest.getBytes(StandardCharsets.UTF_8));
String messageid = new BigInteger(1, md5s).toString(16);
/***
* 第三方回执调用接口可根据业务场景执行
* 注意只能用下面回执对应的机型进行上报点击测试其它机型获取不到 gttask 字段
*
* 60020 华为点击
* 60030 oppo点击
* 60040 vivo点击
* 60070 荣耀点击
*
* 埋点接口对应填写获取到的actionid值如果有获取到 actionid 就上报埋点 果没有则不用上报
*
*/
if (gtaction != null) {
int actionid = Integer.parseInt(gtaction);
result = PushManager.getInstance().sendFeedbackMessage(this, taskid, messageid, actionid);
}
} catch (Exception e) {
//
}
return result;
}
public void onEventMainThread(JpushBean event) {//收到推送 刷新列表

View File

@ -2,6 +2,7 @@ package com.ifish.push;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import com.ifish.activity.PushActivity;
import com.ifish.activity.RecentContactsActivity;
@ -45,8 +46,11 @@ public class IIntentService extends GTIntentService {
super.onNotificationMessageClicked(context, gtNotificationMessage);
L.i("jjia---------通知点击---");
Intent intent = new Intent();
intent.setClass(context, PushActivity.class);
intent.setClass(context, RecentContactsActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
intent.putExtra("payload", "payloadStr");
intent.setData(Uri.parse("gtpushscheme://com.getui.push/detail?"));
context.startActivity(intent);
}
}