This commit is contained in:
parent
c918fccbc8
commit
db2396b7dc
|
|
@ -22,7 +22,7 @@ android {
|
||||||
}
|
}
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
debug {
|
config {
|
||||||
keyAlias 'android.keystore'
|
keyAlias 'android.keystore'
|
||||||
keyPassword 'ifish7'
|
keyPassword 'ifish7'
|
||||||
storeFile file('../ifish7.keystore')
|
storeFile file('../ifish7.keystore')
|
||||||
|
|
@ -81,10 +81,11 @@ android {
|
||||||
buildTypes {
|
buildTypes {
|
||||||
debug {
|
debug {
|
||||||
minifyEnabled false
|
minifyEnabled false
|
||||||
signingConfig signingConfigs.debug
|
signingConfig signingConfigs.config
|
||||||
}
|
}
|
||||||
release {
|
release {
|
||||||
minifyEnabled false
|
minifyEnabled false
|
||||||
|
signingConfig signingConfigs.config
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dexOptions {
|
dexOptions {
|
||||||
|
|
@ -172,20 +173,11 @@ dependencies {
|
||||||
implementation 'com.getui.opt:honor:3.6.0' // 荣耀
|
implementation 'com.getui.opt:honor:3.6.0' // 荣耀
|
||||||
|
|
||||||
|
|
||||||
|
//华为
|
||||||
implementation 'com.huawei.hms:push:6.12.0.300'
|
implementation 'com.huawei.hms:push:6.12.0.300'
|
||||||
// 添加荣耀 SDK
|
// 添加荣耀 SDK
|
||||||
implementation 'com.hihonor.mcs:push:7.0.61.303'
|
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配置以下依赖都需要添加
|
//oppo配置以下依赖都需要添加
|
||||||
// implementation 'com.google.code.gson:gson:2.6.2'
|
|
||||||
implementation 'commons-codec:commons-codec:1.6'
|
implementation 'commons-codec:commons-codec:1.6'
|
||||||
implementation 'com.android.support:support-annotations:28.0.0'
|
implementation 'com.android.support:support-annotations:28.0.0'
|
||||||
}
|
}
|
||||||
|
|
@ -643,8 +643,19 @@
|
||||||
android:theme="@style/Transparent" />
|
android:theme="@style/Transparent" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".RecentContactsActivity"
|
android:name=".RecentContactsActivity"
|
||||||
|
android:exported="true"
|
||||||
android:launchMode="singleTop"
|
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
|
<activity
|
||||||
android:name=".FishGoodsManagerActivity"
|
android:name=".FishGoodsManagerActivity"
|
||||||
android:launchMode="singleTop"
|
android:launchMode="singleTop"
|
||||||
|
|
@ -872,12 +883,12 @@
|
||||||
<!-- 请填写实际的类名,下面仅是示例代码 -->
|
<!-- 请填写实际的类名,下面仅是示例代码 -->
|
||||||
<!-- <service android:name="com.ifish.utils.MyPushIntentService" android:process=":push"/> -->
|
<!-- <service android:name="com.ifish.utils.MyPushIntentService" android:process=":push"/> -->
|
||||||
<!-- taikingdata统计appkey -->
|
<!-- taikingdata统计appkey -->
|
||||||
<meta-data
|
<!-- <meta-data-->
|
||||||
android:name="TD_APP_ID"
|
<!-- android:name="TD_APP_ID"-->
|
||||||
android:value="351E6F7956CEF7FB6AABAEB64EF9BF18" />
|
<!-- android:value="351E6F7956CEF7FB6AABAEB64EF9BF18" />-->
|
||||||
<meta-data
|
<!-- <meta-data-->
|
||||||
android:name="TD_CHANNEL_ID"
|
<!-- android:name="TD_CHANNEL_ID"-->
|
||||||
android:value="Your_channel_id" /> <!-- taikingdata统计appkey -->
|
<!-- android:value="Your_channel_id" /> <!– taikingdata统计appkey –>-->
|
||||||
<!--
|
<!--
|
||||||
<!– 友盟微社区 –>
|
<!– 友盟微社区 –>
|
||||||
<!– feed主页面 –>
|
<!– feed主页面 –>
|
||||||
|
|
@ -995,31 +1006,31 @@ android:configChanges="keyboardHidden|orientation|screenSize" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</receiver> <!-- 配置APP KEY -->
|
</receiver> <!-- 配置APP KEY -->
|
||||||
<!-- 友盟微社区 -->
|
<!-- 友盟微社区 -->
|
||||||
<meta-data
|
<!-- <meta-data-->
|
||||||
android:name="UMENG_APPKEY"
|
<!-- android:name="UMENG_APPKEY"-->
|
||||||
android:value="55f7d5bfe0f55a14770001da" /> <!-- 友盟推送 -->
|
<!-- android:value="55f7d5bfe0f55a14770001da" /> <!– 友盟推送 –>-->
|
||||||
<meta-data
|
<!-- <meta-data-->
|
||||||
android:name="UMENG_MESSAGE_SECRET"
|
<!-- android:name="UMENG_MESSAGE_SECRET"-->
|
||||||
android:value="de4784938fdb6302dcfcf8e5c2ebf15d" />
|
<!-- android:value="de4784938fdb6302dcfcf8e5c2ebf15d" />-->
|
||||||
<meta-data
|
<!-- <meta-data-->
|
||||||
android:name="UMENG_CHANNEL"
|
<!-- android:name="UMENG_CHANNEL"-->
|
||||||
android:value="Unknown" /> <!-- 高德定位 -->
|
<!-- android:value="Unknown" /> <!– 高德定位 –>-->
|
||||||
<meta-data
|
<!-- <meta-data-->
|
||||||
android:name="com.amap.api.v2.apikey"
|
<!-- android:name="com.amap.api.v2.apikey"-->
|
||||||
android:value="1a7ef0b4768ac0c95d6abf6e46b8f1d3" /> <!-- 网易云信 -->
|
<!-- android:value="1a7ef0b4768ac0c95d6abf6e46b8f1d3" /> <!– 网易云信 –>-->
|
||||||
<meta-data
|
<!-- <meta-data-->
|
||||||
android:name="com.netease.nim.appKey"
|
<!-- android:name="com.netease.nim.appKey"-->
|
||||||
android:value="87b0e3315dfc2df08060bcb54246da68" /> <!-- 阿里推送 -->
|
<!-- android:value="87b0e3315dfc2df08060bcb54246da68" /> <!– 阿里推送 –>-->
|
||||||
<meta-data
|
<!-- <meta-data-->
|
||||||
android:name="com.alibaba.app.appkey"
|
<!-- android:name="com.alibaba.app.appkey"-->
|
||||||
android:value="26023230" /> <!-- 请填写你自己的- appKey -->
|
<!-- android:value="26023230" /> <!– 请填写你自己的- appKey –>-->
|
||||||
<meta-data
|
<!-- <meta-data-->
|
||||||
android:name="com.alibaba.app.appsecret"
|
<!-- android:name="com.alibaba.app.appsecret"-->
|
||||||
android:value="03f24e29af6eccb121e516bedbcabf7f" /> <!-- 请填写你自己的appSecret -->
|
<!-- android:value="03f24e29af6eccb121e516bedbcabf7f" /> <!– 请填写你自己的appSecret –>-->
|
||||||
<!-- 在AndroidManifest.xml中配置AppID,其中xxxxx为华为应用的AppID。 -->
|
<!-- 在AndroidManifest.xml中配置AppID,其中xxxxx为华为应用的AppID。 -->
|
||||||
<meta-data
|
<!-- <meta-data-->
|
||||||
android:name="com.huawei.hms.client.appid"
|
<!-- android:name="com.huawei.hms.client.appid"-->
|
||||||
android:value="appid=xxxxxx" />
|
<!-- android:value="appid=xxxxxx" />-->
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|
@ -27,6 +27,7 @@ import com.ifish.utils.AnimationUtil;
|
||||||
import com.ifish.utils.Commons;
|
import com.ifish.utils.Commons;
|
||||||
import com.ifish.utils.HttpListener;
|
import com.ifish.utils.HttpListener;
|
||||||
import com.ifish.utils.HttpManager;
|
import com.ifish.utils.HttpManager;
|
||||||
|
import com.ifish.utils.L;
|
||||||
import com.ifish.utils.PushTypeEnum;
|
import com.ifish.utils.PushTypeEnum;
|
||||||
import com.ifish.utils.ToastUtil;
|
import com.ifish.utils.ToastUtil;
|
||||||
import com.ifish.utils.UnreadCount;
|
import com.ifish.utils.UnreadCount;
|
||||||
|
|
@ -34,14 +35,19 @@ import com.ifish.view.CustomSwipeRefreshLayout;
|
||||||
import com.ifish.view.MyCheckView;
|
import com.ifish.view.MyCheckView;
|
||||||
import com.ifish.view.PopWindowDevice_EventBus;
|
import com.ifish.view.PopWindowDevice_EventBus;
|
||||||
import com.ifish.view.PopWindowPushDel;
|
import com.ifish.view.PopWindowPushDel;
|
||||||
|
import com.igexin.sdk.PushManager;
|
||||||
import com.squareup.picasso.Picasso;
|
import com.squareup.picasso.Picasso;
|
||||||
|
|
||||||
import org.json.JSONArray;
|
import org.json.JSONArray;
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
import java.math.BigInteger;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.security.MessageDigest;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
import de.greenrobot.event.EventBus;
|
import de.greenrobot.event.EventBus;
|
||||||
/**
|
/**
|
||||||
|
|
@ -84,7 +90,65 @@ public class RecentContactsActivity extends BaseFragmentActivity implements Cust
|
||||||
initView();
|
initView();
|
||||||
initListener();
|
initListener();
|
||||||
startData();
|
startData();
|
||||||
|
//获取自定义透传参数值
|
||||||
|
Intent intent = getIntent();
|
||||||
|
if (null != intent) {
|
||||||
|
String payload = intent.getStringExtra("payload");
|
||||||
|
L.i("payload = " + payload);
|
||||||
|
}
|
||||||
|
|
||||||
|
//上报华为、oppo、vivo离线点击数据
|
||||||
|
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) {//收到推送 刷新列表
|
public void onEventMainThread(JpushBean event) {//收到推送 刷新列表
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package com.ifish.push;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.net.Uri;
|
||||||
|
|
||||||
import com.ifish.activity.PushActivity;
|
import com.ifish.activity.PushActivity;
|
||||||
import com.ifish.activity.RecentContactsActivity;
|
import com.ifish.activity.RecentContactsActivity;
|
||||||
|
|
@ -45,8 +46,11 @@ public class IIntentService extends GTIntentService {
|
||||||
super.onNotificationMessageClicked(context, gtNotificationMessage);
|
super.onNotificationMessageClicked(context, gtNotificationMessage);
|
||||||
L.i("jjia---------通知点击---");
|
L.i("jjia---------通知点击---");
|
||||||
Intent intent = new Intent();
|
Intent intent = new Intent();
|
||||||
intent.setClass(context, PushActivity.class);
|
intent.setClass(context, RecentContactsActivity.class);
|
||||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
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);
|
context.startActivity(intent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue