集成云信推送SDK
This commit is contained in:
30
app/agconnect-services.json
Normal file
30
app/agconnect-services.json
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"agcgw":{
|
||||
"backurl":"connect-drcn.dbankcloud.cn",
|
||||
"url":"connect-drcn.hispace.hicloud.com"
|
||||
},
|
||||
"client":{
|
||||
"cp_id":"2850086000357865464",
|
||||
"product_id":"736430079244430800",
|
||||
"client_id":"355467170064368832",
|
||||
"client_secret":"0EAB591E523474B7A0441DD4ED400FBE76F1730E499D028948BDA1AEA24A2232",
|
||||
"app_id":"102156739",
|
||||
"package_name":"com.xuanyi.accompany",
|
||||
"api_key":"CgB6e3x91yYBKcn4fsMK/oZTCZNKo5QCRqE/1K6ZvpxI6drwrIBELZbub05G5yH6UFBmlJfHDyPbZvL3gpAGAxuw"
|
||||
},
|
||||
"service":{
|
||||
"analytics":{
|
||||
"collector_url":"datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn",
|
||||
"resource_id":"p1",
|
||||
"channel_id":""
|
||||
},
|
||||
"cloudstorage":{
|
||||
"storage_url":"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":"1.0"
|
||||
}
|
@@ -255,7 +255,7 @@ dependencies {
|
||||
// api(name: 'base-2.6.1.301', ext: 'aar')
|
||||
// api(name: 'push-2.6.1.301', ext: 'aar')
|
||||
// 魅族推送
|
||||
implementation 'com.meizu.flyme.internet:push-internal:3.6.3@aar'
|
||||
implementation 'com.meizu.flyme.internet:push-internal:3.9.0@aar'
|
||||
// vivo推送
|
||||
implementation files("libs/vivo_pushsdk-v2.9.0.0.aar")
|
||||
//阿里云实名认证
|
||||
@@ -299,7 +299,7 @@ dependencies {
|
||||
|
||||
repositories {
|
||||
flatDir {
|
||||
dirs 'aliyun-libs', 'quick-pass-libs'
|
||||
dirs 'aliyun-libs', 'quick-pass-libs','com.huawei.agconnect'
|
||||
}
|
||||
mavenCentral()
|
||||
}
|
||||
|
@@ -12,6 +12,10 @@
|
||||
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
|
||||
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
|
||||
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
|
||||
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" /> <!-- <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> -->
|
||||
<uses-permission android:name="android.permission.WRITE_SETTINGS" /> <!-- 手机状态 -->
|
||||
<uses-permission android:name="android.permission.CHANGE_CONFIGURATION" /> <!-- 控制呼吸灯,振动器等,用于新消息提醒 -->
|
||||
<uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS" />
|
||||
|
||||
<!-- Required -->
|
||||
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
||||
@@ -29,7 +33,6 @@
|
||||
|
||||
<!-- 云信权限声明 -->
|
||||
<!-- <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />-->
|
||||
|
||||
<!-- 控制呼吸灯,振动器等,用于新消息提醒 -->
|
||||
<uses-permission android:name="android.permission.FLASHLIGHT" />
|
||||
<uses-permission android:name="android.permission.VIBRATE" /> <!-- 外置存储存取权限 -->
|
||||
@@ -40,14 +43,13 @@
|
||||
<uses-permission android:name="android.permission.BLUETOOTH" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
|
||||
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.BROADCAST_STICKY" />
|
||||
<uses-permission android:name="android.permission.REORDER_TASKS" />
|
||||
|
||||
<uses-feature android:name="android.hardware.camera" />
|
||||
<uses-feature android:name="android.hardware.camera.autofocus" />
|
||||
|
||||
<uses-permission android:name="com.coloros.mcs.permission.RECIEVE_MCS_MESSAGE"/>
|
||||
<uses-permission android:name="com.heytap.mcs.permission.RECIEVE_MCS_MESSAGE"/>
|
||||
|
||||
<!-- 如果需要实时音视频通话模块,下面的权限也是必须的。否则,可以不加 -->
|
||||
<uses-feature
|
||||
android:glEsVersion="0x00020000"
|
||||
@@ -56,12 +58,20 @@
|
||||
<permission
|
||||
android:name="${applicationId}.permission.RECEIVE_MSG"
|
||||
android:protectionLevel="signature" /> <!-- 接收 SDK 消息广播权限, 第三方 APP 接入时,请将 com.netease.nim.demo 替换为自己的包名 -->
|
||||
<uses-permission android:name="com.xteam.xchat.permission.RECEIVE_MSG" /> <!-- 云信集成小米推送 start -->
|
||||
<uses-permission android:name="com.xteam.xchat.permission.RECEIVE_MSG" />
|
||||
|
||||
<!-- 云信集成小米推送 start -->
|
||||
<permission
|
||||
android:name="${applicationId}.permission.MIPUSH_RECEIVE"
|
||||
android:protectionLevel="signature" />
|
||||
<uses-permission android:name="${applicationId}.permission.MIPUSH_RECEIVE" />
|
||||
<!-- 云信集成小米推送 end -->
|
||||
|
||||
<uses-sdk tools:overrideLibrary="com.huawei.android.hms.base,com.huawei.android.hms.push" /><!-- 云信集成华为推送 -->
|
||||
|
||||
<uses-permission android:name="com.coloros.mcs.permission.RECIEVE_MCS_MESSAGE" /><!-- 云信集成oppo推送 -->
|
||||
<uses-permission android:name="com.heytap.mcs.permission.RECIEVE_MCS_MESSAGE" />
|
||||
|
||||
<uses-permission android:name="${applicationId}.permission.MIPUSH_RECEIVE" /> <!-- 云信集成小米推送 end -->
|
||||
<!-- 云信集成魅族推送 start -->
|
||||
<!-- 兼容flyme5.0以下版本,魅族内部集成pushSDK必填,不然无法收到消息,将{你的包名} 改开发者App的包名 -->
|
||||
<uses-permission android:name="com.meizu.flyme.push.permission.RECEIVE" />
|
||||
@@ -79,15 +89,13 @@
|
||||
|
||||
<uses-permission android:name="${applicationId}.permission.C2D_MESSAGE" />
|
||||
|
||||
<!--vivo Push需要的权限-->
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
|
||||
<application
|
||||
android:name=".application.XChatApplication"
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/app_logo"
|
||||
android:label="@string/app_name"
|
||||
android:largeHeap="true"
|
||||
android:supportsRtl="true"
|
||||
android:requestLegacyExternalStorage="true"
|
||||
android:resizeableActivity="true"
|
||||
android:theme="@style/MyMaterialTheme"
|
||||
@@ -116,6 +124,8 @@
|
||||
<meta-data
|
||||
android:name="android.max_aspect"
|
||||
android:value="2.4" /> <!-- 刘海屏适配 end -->
|
||||
|
||||
|
||||
<!-- 云信配置 begin ##################################################### -->
|
||||
<!--
|
||||
APP key, 可以在这里设置,也可以在 SDKOptions 中提供。
|
||||
@@ -160,25 +170,37 @@
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
<receiver android:name=".reciever.NotificationClickReceiver" /> <!-- 云信进程间通信provider -->
|
||||
<!-- 云信集成OPPO推送 start -->
|
||||
|
||||
<!-- 云信集成oppo推送 start -->
|
||||
<service
|
||||
android:name="com.netease.nimlib.mixpush.oppo.OppoPushService"
|
||||
android:permission="com.coloros.mcs.permission.SEND_MCS_MESSAGE">
|
||||
<intent-filter>
|
||||
<action android:name="com.coloros.mcs.action.RECEIVE_MCS_MESSAGE"/>
|
||||
<action android:name="com.coloros.mcs.action.RECEIVE_MCS_MESSAGE" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
<service
|
||||
android:name="com.netease.nimlib.mixpush.oppo.OppoAppPushService"
|
||||
android:permission="com.heytap.mcs.permission.SEND_MCS_MESSAGE">
|
||||
<intent-filter>
|
||||
<action android:name="com.heytap.mcs.action.RECEIVE_MCS_MESSAGE"/>
|
||||
<action android:name="com.heytap.mcs.action.RECEIVE_MCS_MESSAGE" />
|
||||
</intent-filter>
|
||||
</service><!-- 云信集成oppo推送 end -->
|
||||
|
||||
<!-- 云信集成华为推送 start -->
|
||||
<service
|
||||
android:name="com.netease.nimlib.mixpush.hw.HWPushService"
|
||||
android:exported="false">
|
||||
<intent-filter>
|
||||
<action android:name="com.huawei.push.action.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
<!-- 云信集成OPPO推送 end -->
|
||||
<!-- 云信集成华为推送 end -->
|
||||
|
||||
<service android:name="com.netease.nimlib.service.ResponseService" />
|
||||
|
||||
<!-- 云信集成小米推送 start -->
|
||||
<!-- android:authorities="{包名}.ipc.provider", 请将com.netease.nim.demo替换为自己的包名 -->
|
||||
<!-- 配置的service和receiver -->
|
||||
<provider
|
||||
android:name="com.netease.nimlib.ipc.NIMContentProvider"
|
||||
android:authorities="${applicationId}.ipc.provider"
|
||||
@@ -234,15 +256,34 @@
|
||||
<action android:name="com.xiaomi.mipush.ERROR" />
|
||||
</intent-filter>
|
||||
</receiver> <!-- 云信集成小米推送 end -->
|
||||
<!-- 云信集成华为推送 start -->
|
||||
|
||||
|
||||
|
||||
<!-- 云信继承vivo推送 start-->
|
||||
<service
|
||||
android:name="com.netease.nimlib.mixpush.hw.HWPushService"
|
||||
android:exported="false">
|
||||
android:name="com.vivo.push.sdk.service.CommandClientService"
|
||||
android:exported="true" />
|
||||
<activity
|
||||
android:name="com.vivo.push.sdk.LinkProxyClientActivity"
|
||||
android:exported="false"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
|
||||
<receiver android:name="com.netease.nimlib.mixpush.vivo.VivoPushReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="com.huawei.push.action.MESSAGING_EVENT" />
|
||||
<!-- 接收 push 消息 -->
|
||||
<action android:name="com.vivo.pushclient.action.RECEIVE" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
<!-- 云信集成华为推送 end -->
|
||||
</receiver>
|
||||
|
||||
<meta-data
|
||||
android:name="com.vivo.push.api_key"
|
||||
android:value="d9aa6e5aaa79b586d81d0f376906043c" />
|
||||
<meta-data
|
||||
android:name="com.vivo.push.app_id"
|
||||
android:value="103904781" />
|
||||
<!-- 云信集成vivo推送 end -->
|
||||
|
||||
|
||||
<!-- 云信集成魅族推送 start -->
|
||||
<!-- 配置的service和receiver -->
|
||||
<receiver android:name="com.netease.nimlib.mixpush.mz.MZPushReceiver">
|
||||
@@ -267,7 +308,9 @@
|
||||
<action android:name="com.meizu.flyme.push.intent.REGISTER.FEEDBACK" />
|
||||
<action android:name="com.meizu.flyme.push.intent.UNREGISTER.FEEDBACK" />
|
||||
</intent-filter>
|
||||
</receiver> <!-- 云信集成魅族推送 end -->
|
||||
</receiver>
|
||||
<!-- 云信集成魅族推送 end -->
|
||||
|
||||
<!-- 云信配置 end ##################################################### -->
|
||||
<!-- <!– 安卓保活配置 –> -->
|
||||
<!-- <service -->
|
||||
@@ -287,29 +330,6 @@
|
||||
<!-- autolayout####################################################配置 -->
|
||||
<!--Vivo Push需要配置的service、activity-->
|
||||
<!--配置的service, activity, receiver-->
|
||||
<service
|
||||
android:name="com.vivo.push.sdk.service.CommandClientService"
|
||||
android:exported="true" />
|
||||
<activity
|
||||
android:name="com.vivo.push.sdk.LinkProxyClientActivity"
|
||||
android:exported="false"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
|
||||
<receiver android:name="com.netease.nimlib.mixpush.vivo.VivoPushReceiver">
|
||||
<intent-filter>
|
||||
<!-- 接收 push 消息 -->
|
||||
<action android:name="com.vivo.pushclient.action.RECEIVE" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
<!--Vivo Push开放平台中应用的appid 和api key-->
|
||||
<meta-data
|
||||
android:name="com.vivo.push.api_key"
|
||||
android:value="1a9cace2-da8a-4b49-a70d-9beefacf6096" />
|
||||
<meta-data
|
||||
android:name="com.vivo.push.app_id"
|
||||
android:value="16517" />
|
||||
|
||||
|
||||
|
||||
<meta-data
|
||||
android:name="design_width"
|
||||
@@ -1022,6 +1042,9 @@
|
||||
<activity
|
||||
android:name="com.yizhuan.tutu.room_chat.activity.RoomMsgActivity"
|
||||
android:theme="@style/room_message_activity" />
|
||||
<activity
|
||||
android:name="com.yizhuan.tutu.room_chat.activity.RoomInviteFansActivity"
|
||||
android:theme="@style/room_message_activity" />
|
||||
<activity
|
||||
android:name="com.yizhuan.tutu.room_chat.activity.NimTeamRoomMessageActivity"
|
||||
android:screenOrientation="portrait"
|
||||
|
@@ -25,6 +25,7 @@ import com.baidu.mobstat.StatService;
|
||||
import com.bumptech.glide.request.target.ViewTarget;
|
||||
import com.bun.miitmdid.core.JLibrary;
|
||||
import com.coorchice.library.utils.LogUtils;
|
||||
import com.huawei.hms.support.common.ActivityMgr;
|
||||
import com.ishumei.smantifraud.SmAntiFraud;
|
||||
import com.llew.huawei.verifier.LoadedApkHuaWei;
|
||||
import com.microquation.linkedme.android.LinkedME;
|
||||
@@ -106,6 +107,19 @@ import io.reactivex.plugins.RxJavaPlugins;
|
||||
import io.realm.Realm;
|
||||
import io.realm.RealmConfiguration;
|
||||
|
||||
import static com.yizhuan.xchat_android_constants.XChatConstants.HW_APP_ID;
|
||||
import static com.yizhuan.xchat_android_constants.XChatConstants.HW_CERTIFICATE_NAME;
|
||||
import static com.yizhuan.xchat_android_constants.XChatConstants.MZ_APP_ID;
|
||||
import static com.yizhuan.xchat_android_constants.XChatConstants.MZ_APP_KEY;
|
||||
import static com.yizhuan.xchat_android_constants.XChatConstants.MZ_CERTIFICATE_NAME;
|
||||
import static com.yizhuan.xchat_android_constants.XChatConstants.OPPO_APP_ID;
|
||||
import static com.yizhuan.xchat_android_constants.XChatConstants.OPPO_APP_KEY;
|
||||
import static com.yizhuan.xchat_android_constants.XChatConstants.OPPO_CERTIFICATE_NAME;
|
||||
import static com.yizhuan.xchat_android_constants.XChatConstants.OPPO_SECRET;
|
||||
import static com.yizhuan.xchat_android_constants.XChatConstants.VIVO_CERTIFICATE_NAME;
|
||||
import static com.yizhuan.xchat_android_constants.XChatConstants.XM_APP_ID;
|
||||
import static com.yizhuan.xchat_android_constants.XChatConstants.XM_APP_KEY;
|
||||
import static com.yizhuan.xchat_android_constants.XChatConstants.XM_CERTIFICATE_NAME;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_HEADER_TYPE_OPEN_ROOM_NOTI;
|
||||
|
||||
/**
|
||||
@@ -223,7 +237,7 @@ public class XChatApplication extends Application {
|
||||
lifeManager = new ActivityLifeManager();
|
||||
}
|
||||
registerActivityLifecycleCallback(lifeManager);
|
||||
|
||||
ActivityMgr.INST.init(this);
|
||||
|
||||
}
|
||||
dealHuaWeiCrash();
|
||||
@@ -364,24 +378,24 @@ public class XChatApplication extends Application {
|
||||
DemoCache.setNotificationConfig(config);
|
||||
|
||||
MixPushConfig mixPushConfig = new MixPushConfig();
|
||||
/* mixPushConfig.hwCertificateName = "tutuHuaweiAndroid";
|
||||
|
||||
mixPushConfig.mzAppId = "125242";
|
||||
mixPushConfig.mzAppKey = "1c478e5eaace4c41ba269d2ca7c9bd69";
|
||||
mixPushConfig.mzCertificateName = "qingxunMeizuAndroid2";
|
||||
|
||||
mixPushConfig.xmAppId = "2882303761518089228";
|
||||
mixPushConfig.xmAppKey = "5781808939228";
|
||||
mixPushConfig.xmCertificateName = "qingxunXiaomiAndroid";
|
||||
|
||||
mixPushConfig.vivoCertificateName = "qingxunVivoAndroid";*/
|
||||
|
||||
// 下架状态,没有完成接入
|
||||
mixPushConfig.oppoAppId = "30272213";
|
||||
mixPushConfig.oppoAppKey = "631b6753a1fa481e88dd57793a04e531";
|
||||
mixPushConfig.oppoAppSercet = "c963ee7c0ba54fbfb3124b4aa7011b17";
|
||||
mixPushConfig.oppoCertificateName = "accompanyOppoAndroid";
|
||||
|
||||
//华为推送
|
||||
mixPushConfig.hwAppId = HW_APP_ID;
|
||||
mixPushConfig.hwCertificateName = HW_CERTIFICATE_NAME;
|
||||
//小米推送
|
||||
mixPushConfig.xmAppId = XM_APP_ID;
|
||||
mixPushConfig.xmAppKey = XM_APP_KEY;
|
||||
mixPushConfig.xmCertificateName = XM_CERTIFICATE_NAME;
|
||||
//魅族推送
|
||||
mixPushConfig.mzAppId = MZ_APP_ID;
|
||||
mixPushConfig.mzAppKey = MZ_APP_KEY;
|
||||
mixPushConfig.mzCertificateName = MZ_CERTIFICATE_NAME;
|
||||
//vivo推送
|
||||
mixPushConfig.vivoCertificateName = VIVO_CERTIFICATE_NAME;
|
||||
//oppo推送
|
||||
mixPushConfig.oppoAppId = OPPO_APP_ID;
|
||||
mixPushConfig.oppoAppKey = OPPO_APP_KEY;
|
||||
mixPushConfig.oppoAppSercet = OPPO_SECRET;
|
||||
mixPushConfig.oppoCertificateName = OPPO_CERTIFICATE_NAME;
|
||||
options.mixPushConfig = mixPushConfig;
|
||||
|
||||
return options;
|
||||
|
@@ -13,7 +13,7 @@ buildscript {
|
||||
maven { url 'https://jitpack.io' }
|
||||
google()
|
||||
jcenter()
|
||||
maven {url 'https://developer.huawei.com/repo/'}
|
||||
maven {url 'http://developer.huawei.com/repo/'}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
@@ -38,7 +38,7 @@ allprojects {
|
||||
maven { url "http://mvn.mob.com/android" }
|
||||
maven { url 'https://dl.bintray.com/umsdk/release' }
|
||||
maven { url 'https://dl.bintray.com/linkedme2016/lkme-deeplinks' }
|
||||
maven { url 'https://developer.huawei.com/repo/'}
|
||||
maven { url 'http://developer.huawei.com/repo/' }
|
||||
}
|
||||
//网络慢的话就去 https://maven.aliyun.com/mvn/view 里面找个代理的仓库。
|
||||
}
|
||||
|
@@ -268,6 +268,35 @@ public class XChatConstants {
|
||||
public static final String REPORT_TYPE_DYNAMIC_SQUARE = "DYNAMIC_SQUARE";//广场动态
|
||||
|
||||
|
||||
/**
|
||||
* 小米推送
|
||||
*/
|
||||
public static final String XM_APP_ID = "2882303761518389079";
|
||||
public static final String XM_APP_KEY = "5551838995079";
|
||||
public static final String XM_CERTIFICATE_NAME = "accompanyXiaomiAndroid";
|
||||
/**
|
||||
* 魅族推送
|
||||
*/
|
||||
public static final String MZ_APP_ID = "133017";
|
||||
public static final String MZ_APP_KEY = "402fef6295cc493fbd6d7b9b179df7b5";
|
||||
public static final String MZ_CERTIFICATE_NAME = "accompanyMeizu";
|
||||
/**
|
||||
* 华为推送
|
||||
*/
|
||||
public static final String HW_APP_ID = "102156739";
|
||||
public static final String HW_CERTIFICATE_NAME = "accompanyHuawei";
|
||||
/**
|
||||
* vivo推送
|
||||
*/
|
||||
public static final String VIVO_CERTIFICATE_NAME = "accompanyVivo";
|
||||
/**
|
||||
* oppo推送
|
||||
*/
|
||||
public static final String OPPO_CERTIFICATE_NAME = "accompanyOppo";
|
||||
public static final String OPPO_APP_ID = "30272213";
|
||||
public static final String OPPO_APP_KEY = "631b6753a1fa481e88dd57793a04e531";
|
||||
public static final String OPPO_SECRET = "c963ee7c0ba54fbfb3124b4aa7011b17";
|
||||
|
||||
// 侧耳
|
||||
// public static final String QUICK_PASS_BUSINESS_ID = BuildConfig.DEBUG ? "cadbb4ed892549dab4d1adc9d62013bb" : "ba4a642810294561b9cd17034a448b49";
|
||||
|
||||
|
Reference in New Issue
Block a user