push
This commit is contained in:
parent
715842ad19
commit
7a09325450
|
|
@ -9,12 +9,14 @@ buildscript {
|
|||
maven { url 'https://maven.aliyun.com/repository/google' }
|
||||
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
|
||||
maven {url 'https://dl.google.com/dl/android/maven2/'}
|
||||
maven {url 'https://developer.huawei.com/repo/'}
|
||||
mavenCentral()
|
||||
google()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:7.4.2'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
classpath 'com.huawei.agconnect:agcp:1.6.0.300'
|
||||
}
|
||||
}
|
||||
allprojects {
|
||||
|
|
@ -32,6 +34,7 @@ allprojects {
|
|||
maven {
|
||||
url "https://mvn.getui.com/nexus/content/repositories/releases/"
|
||||
}
|
||||
maven {url 'https://developer.huawei.com/repo/'}
|
||||
mavenCentral()
|
||||
google()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,96 @@
|
|||
{
|
||||
"agcgw":{
|
||||
"backurl":"connect-drcn.hispace.hicloud.com",
|
||||
"url":"connect-drcn.dbankcloud.cn",
|
||||
"websocketbackurl":"connect-ws-drcn.hispace.dbankcloud.com",
|
||||
"websocketurl":"connect-ws-drcn.hispace.dbankcloud.cn"
|
||||
},
|
||||
"agcgw_all":{
|
||||
"CN":"connect-drcn.dbankcloud.cn",
|
||||
"CN_back":"connect-drcn.hispace.hicloud.com",
|
||||
"DE":"connect-dre.dbankcloud.cn",
|
||||
"DE_back":"connect-dre.hispace.hicloud.com",
|
||||
"RU":"connect-drru.hispace.dbankcloud.ru",
|
||||
"RU_back":"connect-drru.hispace.dbankcloud.cn",
|
||||
"SG":"connect-dra.dbankcloud.cn",
|
||||
"SG_back":"connect-dra.hispace.hicloud.com"
|
||||
},
|
||||
"websocketgw_all":{
|
||||
"CN":"connect-ws-drcn.hispace.dbankcloud.cn",
|
||||
"CN_back":"connect-ws-drcn.hispace.dbankcloud.com",
|
||||
"DE":"connect-ws-dre.hispace.dbankcloud.cn",
|
||||
"DE_back":"connect-ws-dre.hispace.dbankcloud.com",
|
||||
"RU":"connect-ws-drru.hispace.dbankcloud.ru",
|
||||
"RU_back":"connect-ws-drru.hispace.dbankcloud.cn",
|
||||
"SG":"connect-ws-dra.hispace.dbankcloud.cn",
|
||||
"SG_back":"connect-ws-dra.hispace.dbankcloud.com"
|
||||
},
|
||||
"client":{
|
||||
"cp_id":"890086000102127924",
|
||||
"product_id":"9105163812218561779",
|
||||
"client_id":"1547712531919838400",
|
||||
"client_secret":"666E65676105422D3DEC5D9ECFE7608C9E084483A805E04F3F707F393C7436AC",
|
||||
"project_id":"9105163812218561779",
|
||||
"app_id":"100849149",
|
||||
"api_key":"DQEDAD7Gt+1DuuwJHy/CWXtdrYlr6rhmlx2N3QaWF+sAcd3pdEAMq/hGvWY2gnzSEEVw1QSSyuhOtSevrlXCeKDMXtERtntJOojOZQ==",
|
||||
"package_name":"com.ifish.activity"
|
||||
},
|
||||
"oauth_client":{
|
||||
"client_id":"100849149",
|
||||
"client_type":1
|
||||
},
|
||||
"app_info":{
|
||||
"app_id":"100849149",
|
||||
"package_name":"com.ifish.activity"
|
||||
},
|
||||
"service":{
|
||||
"analytics":{
|
||||
"collector_url":"datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn",
|
||||
"collector_url_ru":"datacollector-drru.dt.dbankcloud.ru,datacollector-drru.dt.hicloud.com",
|
||||
"collector_url_sg":"datacollector-dra.dt.hicloud.com,datacollector-dra.dt.dbankcloud.cn",
|
||||
"collector_url_de":"datacollector-dre.dt.hicloud.com,datacollector-dre.dt.dbankcloud.cn",
|
||||
"collector_url_cn":"datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn",
|
||||
"resource_id":"p1",
|
||||
"channel_id":""
|
||||
},
|
||||
"edukit":{
|
||||
"edu_url":"edukit.cloud.huawei.com.cn",
|
||||
"dh_url":"edukit.cloud.huawei.com.cn"
|
||||
},
|
||||
"search":{
|
||||
"url":"https://search-drcn.cloud.huawei.com"
|
||||
},
|
||||
"cloudstorage":{
|
||||
"storage_url_sg_back":"https://agc-storage-dra.cloud.huawei.asia",
|
||||
"storage_url_ru_back":"https://agc-storage-drru.cloud.huawei.ru",
|
||||
"storage_url_ru":"https://agc-storage-drru.cloud.huawei.ru",
|
||||
"storage_url_de_back":"https://agc-storage-dre.cloud.huawei.eu",
|
||||
"storage_url_de":"https://ops-dre.agcstorage.link",
|
||||
"storage_url":"https://agc-storage-drcn.platform.dbankcloud.cn",
|
||||
"storage_url_sg":"https://ops-dra.agcstorage.link",
|
||||
"storage_url_cn_back":"https://agc-storage-drcn.cloud.huawei.com.cn",
|
||||
"storage_url_cn":"https://agc-storage-drcn.platform.dbankcloud.cn"
|
||||
},
|
||||
"ml":{
|
||||
"mlservice_url":"ml-api-drcn.ai.dbankcloud.com,ml-api-drcn.ai.dbankcloud.cn"
|
||||
}
|
||||
},
|
||||
"region":"CN",
|
||||
"configuration_version":"3.0",
|
||||
"appInfos":[
|
||||
{
|
||||
"package_name":"com.ifish.activity",
|
||||
"client":{
|
||||
"app_id":"100849149"
|
||||
},
|
||||
"app_info":{
|
||||
"package_name":"com.ifish.activity",
|
||||
"app_id":"100849149"
|
||||
},
|
||||
"oauth_client":{
|
||||
"client_type":1,
|
||||
"client_id":"100849149"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -49,6 +49,27 @@ android {
|
|||
//从 3.1.2.0 版本开始,APPID 占位符从 GETUI_APP_ID 切换为 GETUI_APPID
|
||||
//后续所有产品的 APPID 均统一配置为 GETUI_APPID 占位符
|
||||
GETUI_APPID : "C2ZpsHzexi5UKuUKyW0Ig",
|
||||
// 华为 相关应用参数
|
||||
HUAWEI_APP_ID : "100849149",
|
||||
|
||||
// 小米相关应用参数
|
||||
XIAOMI_APP_ID : "2882303761517421890",
|
||||
XIAOMI_APP_KEY : "5491742138890",
|
||||
|
||||
// OPPO 相关应用参数
|
||||
OPPO_APP_KEY : "",
|
||||
OPPO_APP_SECRET: "",
|
||||
|
||||
// VIVO 相关应用参数
|
||||
VIVO_APP_ID : "",
|
||||
VIVO_APP_KEY : "",
|
||||
|
||||
// 魅族相关应用参数
|
||||
MEIZU_APP_ID : "",
|
||||
MEIZU_APP_KEY : "",
|
||||
|
||||
// 荣耀相关应用参数
|
||||
HONOR_APP_ID : "",
|
||||
]
|
||||
|
||||
}
|
||||
|
|
@ -129,11 +150,17 @@ dependencies {
|
|||
implementation 'com.tencent:mmkv:2.0.0'
|
||||
implementation("com.github.bumptech.glide:okhttp3-integration:4.11.0" )
|
||||
// implementation 'com.github.Jasonchenlijian:FastBle:2.4.0'
|
||||
// implementation 'com.getui:gtsdk:3.3.7.0' //个推SDK
|
||||
// implementation 'com.getui:gtc:3.2.16.0' //个推核心组件
|
||||
|
||||
implementation 'io.github.lucksiege:pictureselector:v3.11.2'
|
||||
// 图片压缩 (按需引入)
|
||||
implementation 'io.github.lucksiege:compress:v3.11.2'
|
||||
// 图片裁剪 (按需引入)
|
||||
implementation 'io.github.lucksiege:ucrop:v3.11.2'
|
||||
|
||||
|
||||
//推送
|
||||
implementation 'com.getui:gtsdk:3.3.9.0' //个推SDK
|
||||
implementation 'com.getui:gtc:3.2.18.0' //个推核心组件
|
||||
implementation 'com.getui.opt:xmp:3.3.1' // 小米
|
||||
implementation 'com.huawei.hms:push:6.12.0.300'
|
||||
}
|
||||
|
|
@ -91,7 +91,11 @@
|
|||
</action>
|
||||
</intent>
|
||||
</queries>
|
||||
|
||||
<queries>
|
||||
<intent>
|
||||
<action android:name="com.getui.sdk.action" />
|
||||
</intent>
|
||||
</queries>
|
||||
<application
|
||||
android:name="com.ifish.baseclass.BaseApplication"
|
||||
android:allowBackup="false"
|
||||
|
|
@ -104,12 +108,12 @@
|
|||
tools:replace="android:icon,android:theme,android:allowBackup">
|
||||
|
||||
<!-- 推送服务 jjia-push-->
|
||||
<!-- <service-->
|
||||
<!-- android:name="com.ifish.push.IPushService"-->
|
||||
<!-- android:exported="false"-->
|
||||
<!-- android:label="PushService"-->
|
||||
<!-- android:process=":pushservice" />-->
|
||||
<!-- <service android:name="com.ifish.push.IIntentService" />-->
|
||||
<service
|
||||
android:name="com.ifish.push.IPushService"
|
||||
android:exported="false"
|
||||
android:label="PushService"
|
||||
android:process=":pushservice" />
|
||||
<service android:name="com.ifish.push.IIntentService" />
|
||||
<activity
|
||||
android:name=".NewBindDeviceChoiceActivity"
|
||||
android:exported="false"
|
||||
|
|
|
|||
|
|
@ -24,9 +24,11 @@ import androidx.multidex.MultiDexApplication;
|
|||
import com.ifish.activity.BuildConfig;
|
||||
import com.ifish.utils.ActivityManager;
|
||||
import com.ifish.utils.ImageDownLoader;
|
||||
import com.ifish.utils.L;
|
||||
import com.ifish.utils.SystemUtil;
|
||||
import com.ifish.utils.TrustAllCerts;
|
||||
//import com.igexin.sdk.PushManager;
|
||||
import com.igexin.sdk.PushManager;
|
||||
import com.p2p.core.P2PSpecial.P2PSpecial;
|
||||
import com.squareup.picasso.Picasso;
|
||||
|
||||
|
|
@ -146,9 +148,9 @@ public class BaseApplication extends MultiDexApplication {
|
|||
// jjia-push
|
||||
// IPushService
|
||||
// IIntentService
|
||||
// PushManager.getInstance().preInit(this);
|
||||
// PushManager.getInstance().initialize(this);
|
||||
// PushManager.getInstance().setDebugLogger(this, s -> L.i("jjia--------"+s));
|
||||
PushManager.getInstance().preInit(this);
|
||||
PushManager.getInstance().initialize(this);
|
||||
PushManager.getInstance().setDebugLogger(this, s -> L.i("jjia--------"+s));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -114,6 +114,7 @@ import com.ifish.view.LevelDialog;
|
|||
import com.ifish.view.MyBGARefreshLayout;
|
||||
import com.ifish.view.MyListView;
|
||||
import com.ifish.view.ObservableScrollView;
|
||||
import com.igexin.sdk.PushManager;
|
||||
import com.jude.rollviewpager.OnItemClickListener;
|
||||
import com.jude.rollviewpager.RollPagerView;
|
||||
import com.jude.rollviewpager.hintview.ColorPointHintView;
|
||||
|
|
@ -215,9 +216,36 @@ public class DeviceFragment extends BaseV4Fragment implements ObservableScrollVi
|
|||
permission = new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION};
|
||||
permissionHelper = new PermissionHelper(DeviceFragment.this, permission, 250);
|
||||
// initBooth();
|
||||
boolean notificationsEnabled = PushManager.getInstance().areNotificationsEnabled(requireActivity());
|
||||
if (!notificationsEnabled){
|
||||
toOpenNotifications();
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
||||
private void toOpenNotifications(){
|
||||
|
||||
AlertDialog.Builder dialog = new AlertDialog.Builder(getContext());
|
||||
dialog.setCancelable(false);
|
||||
dialog.setTitle("温馨提示");
|
||||
dialog.setMessage("您开启通知权限,通知权限被关闭后,重要服务通知均无法正常触达通知您,是否去开启通知权限?");
|
||||
dialog.setPositiveButton("去开启", new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(
|
||||
DialogInterface dialog,
|
||||
int which) {
|
||||
PushManager.getInstance().openNotification(requireContext());
|
||||
|
||||
}
|
||||
});
|
||||
dialog.setNegativeButton("取消", new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
}
|
||||
});
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
private void getPermission() {
|
||||
permissionHelper.request(new PermissionHelper.PermissionCallback() {
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -1,51 +1,51 @@
|
|||
//package com.ifish.push;
|
||||
//
|
||||
//import android.content.Context;
|
||||
//import android.content.Intent;
|
||||
//
|
||||
//import com.ifish.activity.PushActivity;
|
||||
//import com.ifish.activity.RecentContactsActivity;
|
||||
//import com.ifish.baseclass.BaseApplication;
|
||||
//import com.ifish.utils.L;
|
||||
//import com.igexin.sdk.GTIntentService;
|
||||
//import com.igexin.sdk.message.GTNotificationMessage;
|
||||
//import com.igexin.sdk.message.GTTransmitMessage;
|
||||
//
|
||||
//public class IIntentService extends GTIntentService {
|
||||
//
|
||||
// @Override
|
||||
// public void onReceiveClientId(Context context, String s) {
|
||||
// super.onReceiveClientId(context, s);
|
||||
// L.i("jjia----------push--cid--"+s);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onReceiveMessageData(Context context, GTTransmitMessage gtTransmitMessage) {
|
||||
// super.onReceiveMessageData(context, gtTransmitMessage);
|
||||
// }
|
||||
//
|
||||
// // cid离线上线通知
|
||||
// @Override
|
||||
// public void onReceiveOnlineState(Context context, boolean b) {
|
||||
// super.onReceiveOnlineState(context, b);
|
||||
// }
|
||||
//
|
||||
// // 通知到达
|
||||
// @Override
|
||||
// public void onNotificationMessageArrived(Context context, GTNotificationMessage gtNotificationMessage) {
|
||||
// super.onNotificationMessageArrived(context, gtNotificationMessage);
|
||||
//
|
||||
// L.i("jjia---------通知到达---");
|
||||
// }
|
||||
//
|
||||
// //通知点击
|
||||
// @Override
|
||||
// public void onNotificationMessageClicked(Context context, GTNotificationMessage gtNotificationMessage) {
|
||||
// super.onNotificationMessageClicked(context, gtNotificationMessage);
|
||||
// L.i("jjia---------通知点击---");
|
||||
// Intent intent = new Intent();
|
||||
// intent.setClass(context, PushActivity.class);
|
||||
// intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
// context.startActivity(intent);
|
||||
// }
|
||||
//}
|
||||
package com.ifish.push;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
||||
import com.ifish.activity.PushActivity;
|
||||
import com.ifish.activity.RecentContactsActivity;
|
||||
import com.ifish.baseclass.BaseApplication;
|
||||
import com.ifish.utils.L;
|
||||
import com.igexin.sdk.GTIntentService;
|
||||
import com.igexin.sdk.message.GTNotificationMessage;
|
||||
import com.igexin.sdk.message.GTTransmitMessage;
|
||||
|
||||
public class IIntentService extends GTIntentService {
|
||||
|
||||
@Override
|
||||
public void onReceiveClientId(Context context, String s) {
|
||||
super.onReceiveClientId(context, s);
|
||||
L.i("jjia----------push--cid--"+s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceiveMessageData(Context context, GTTransmitMessage gtTransmitMessage) {
|
||||
super.onReceiveMessageData(context, gtTransmitMessage);
|
||||
}
|
||||
|
||||
// cid离线上线通知
|
||||
@Override
|
||||
public void onReceiveOnlineState(Context context, boolean b) {
|
||||
super.onReceiveOnlineState(context, b);
|
||||
}
|
||||
|
||||
// 通知到达
|
||||
@Override
|
||||
public void onNotificationMessageArrived(Context context, GTNotificationMessage gtNotificationMessage) {
|
||||
super.onNotificationMessageArrived(context, gtNotificationMessage);
|
||||
|
||||
L.i("jjia---------通知到达---");
|
||||
}
|
||||
|
||||
//通知点击
|
||||
@Override
|
||||
public void onNotificationMessageClicked(Context context, GTNotificationMessage gtNotificationMessage) {
|
||||
super.onNotificationMessageClicked(context, gtNotificationMessage);
|
||||
L.i("jjia---------通知点击---");
|
||||
Intent intent = new Intent();
|
||||
intent.setClass(context, PushActivity.class);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package com.ifish.push;
|
||||
|
||||
//import com.igexin.sdk.PushService;
|
||||
//
|
||||
//public class IPushService extends PushService {
|
||||
//}
|
||||
import com.igexin.sdk.PushService;
|
||||
|
||||
public class IPushService extends PushService {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4465,7 +4465,7 @@ public class HttpManager {
|
|||
RequestParams requestParams = new RequestParams();
|
||||
requestParams.addBodyParameter("userId", userId);
|
||||
requestParams.addBodyParameter("deviceId", deviceId);
|
||||
// requestParams.addBodyParameter("type", "1");
|
||||
requestParams.addBodyParameter("type", "1");
|
||||
requestParams.addBodyParameter("phoneType", "ANDROID");
|
||||
String curTime = System.currentTimeMillis() / 1000 + "";
|
||||
String nonce = getRandomNum() + "";
|
||||
|
|
|
|||
Loading…
Reference in New Issue