Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
ShenghuoquanBusiness
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bp
ShenghuoquanBusiness
Commits
07eb40c2
Commit
07eb40c2
authored
Aug 05, 2021
by
chengkun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
在组件application中初始化推送模块
parent
d8853347
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
376 additions
and
57 deletions
+376
-57
AppConfig.kt
...on/src/main/java/com/yidian/bcommon/constant/AppConfig.kt
+2
-2
UMConfigUtils.kt
...n/src/main/java/com/yidian/bcommon/utils/UMConfigUtils.kt
+1
-0
BPushApplication.kt
...ava/com/yidian/shenghuoquan/bpush/app/BPushApplication.kt
+2
-0
BPush.kt
...src/main/java/com/yidian/shenghuoquan/bpush/base/BPush.kt
+57
-0
UmengPushPolicy.kt
...dian/shenghuoquan/bpush/push/umengpush/UmengPushPolicy.kt
+25
-3
PushConstants.java
...enghuoquan/bpush/push/umengpush/helper/PushConstants.java
+64
-0
PushHelper.java
.../shenghuoquan/bpush/push/umengpush/helper/PushHelper.java
+189
-0
PushService.kt
...java/com/yidian/shenghuoquan/bpush/service/PushService.kt
+3
-22
push-sdk-so.zip
Components/BPush/src/main/jni/push-sdk-so.zip
+0
-0
BaseInitConfig.kt
...main/java/com/yidian/shenghuoquan/broot/BaseInitConfig.kt
+1
-1
LoginLifeCircleActivity.kt
...shenghuoquan/bsetting/ui/login/LoginLifeCircleActivity.kt
+3
-0
agconnect-services.json
app/agconnect-services.json
+15
-15
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+9
-12
BusinessApplication.kt
...ain/java/com/shenghuoquan/business/BusinessApplication.kt
+5
-2
No files found.
CommonLib/BCommon/src/main/java/com/yidian/bcommon/constant/AppConfig.kt
View file @
07eb40c2
...
@@ -78,10 +78,10 @@ class AppConfig {
...
@@ -78,10 +78,10 @@ class AppConfig {
const
val
commonProblem
=
"https://www.appgc.cn/plugins/privacy/content?type=privacy&appId=1080334&ver=210601"
const
val
commonProblem
=
"https://www.appgc.cn/plugins/privacy/content?type=privacy&appId=1080334&ver=210601"
// 友盟测试环境配置
// 友盟测试环境配置
const
val
UMAppTestKey
=
"6
0c8479fe044530ff0a49936
"
//umeng统计key注释
const
val
UMAppTestKey
=
"6
108ab43864a9558e6da2ba5
"
//umeng统计key注释
const
val
UMTestChannel
=
"ANDROID_CHANNEL"
const
val
UMTestChannel
=
"ANDROID_CHANNEL"
const
val
UMTestType
=
"metro"
const
val
UMTestType
=
"metro"
const
val
UMTestPushSecret
=
"
e78446e86d153e2891ae7523e1532f13
"
// push secret
const
val
UMTestPushSecret
=
"
3bebc2c01765946dbf1823f9cf4b3604
"
// push secret
// 友盟线上环境配置
// 友盟线上环境配置
const
val
UMAppKey
=
"60ccc0c68a102159db70438c"
//umeng统计key注释
const
val
UMAppKey
=
"60ccc0c68a102159db70438c"
//umeng统计key注释
...
...
CommonLib/BCommon/src/main/java/com/yidian/bcommon/utils/UMConfigUtils.kt
View file @
07eb40c2
...
@@ -21,6 +21,7 @@ class UMConfigUtils {
...
@@ -21,6 +21,7 @@ class UMConfigUtils {
* 预初始化
* 预初始化
*/
*/
fun
preInit
(
context
:
Context
)
{
fun
preInit
(
context
:
Context
)
{
UMConfigure
.
setLogEnabled
(
true
)
if
(
BuildConfig
.
IS_UMENG_RELEASE
)
{
if
(
BuildConfig
.
IS_UMENG_RELEASE
)
{
UMConfigure
.
preInit
(
context
,
AppConfig
.
UMAppKey
,
AppConfig
.
UMChannel
)
UMConfigure
.
preInit
(
context
,
AppConfig
.
UMAppKey
,
AppConfig
.
UMChannel
)
}
else
{
}
else
{
...
...
Components/BPush/src/main/java/com/yidian/shenghuoquan/bpush/app/BPushApplication.kt
View file @
07eb40c2
...
@@ -4,6 +4,7 @@ import android.content.Context
...
@@ -4,6 +4,7 @@ import android.content.Context
import
com.yidian.bcommon.app.YdBaseApplication
import
com.yidian.bcommon.app.YdBaseApplication
import
com.yidian.bcommon.services.ZapServiceNameConstants
import
com.yidian.bcommon.services.ZapServiceNameConstants
import
com.yidian.news.util.ProcessUtil
import
com.yidian.news.util.ProcessUtil
import
com.yidian.shenghuoquan.bpush.base.BPush
import
com.yidian.shenghuoquan.bpush.service.PushService
import
com.yidian.shenghuoquan.bpush.service.PushService
import
com.yidian.yac.core.core.YacModuleSpec
import
com.yidian.yac.core.core.YacModuleSpec
import
com.yidian.yac.core.zap.Zap
import
com.yidian.yac.core.zap.Zap
...
@@ -21,6 +22,7 @@ class BPushApplication: YdBaseApplication() {
...
@@ -21,6 +22,7 @@ class BPushApplication: YdBaseApplication() {
registerXpage
()
registerXpage
()
initService
()
initService
()
}
}
BPush
().
init
(
this
)
}
}
private
fun
registerXpage
()
{
private
fun
registerXpage
()
{
...
...
Components/BPush/src/main/java/com/yidian/shenghuoquan/bpush/base/BPush.kt
0 → 100644
View file @
07eb40c2
package
com.yidian.shenghuoquan.bpush.base
import
android.content.Context
import
com.umeng.commonsdk.UMConfigure
import
com.yidian.shenghuoquan.bpush.constant.BrandConstant
import
com.yidian.shenghuoquan.bpush.constant.Constant
import
com.yidian.shenghuoquan.bpush.push.PushSdkManager
import
com.yidian.shenghuoquan.bpush.push.huaweipush.HuaWeiPushPolicy
import
com.yidian.shenghuoquan.bpush.push.mipush.MiPushPolicy
import
com.yidian.shenghuoquan.bpush.push.oppopush.OppoPushPolicy
import
com.yidian.shenghuoquan.bpush.push.umengpush.UmengPushPolicy
import
com.yidian.shenghuoquan.bpush.push.umengpush.helper.PushHelper
import
com.yidian.shenghuoquan.bpush.push.vivopush.ViVoPushPolicy
import
com.yidian.shenghuoquan.bpush.utils.SystemUtil
import
timber.log.Timber
class
BPush
{
private
lateinit
var
pushSdkManager
:
PushSdkManager
public
fun
init
(
context
:
Context
)
{
// 开关
UMConfigure
.
setLogEnabled
(
true
)
//预初始化
PushHelper
.
preInit
(
context
)
//正式初始化
if
(
PushHelper
.
isMainProcess
(
context
))
{
//建议在线程中执行初始化
Thread
{
PushHelper
.
init
(
context
)
}.
start
()
}
initPlatformPush
()
}
private
fun
initPlatformPush
()
{
if
(
this
::
pushSdkManager
.
isInitialized
&&
pushSdkManager
.
pushStatus
()
==
Constant
.
pushConnected
)
{
Timber
.
tag
(
"BPush"
).
i
(
"push sdk has initiallized"
)
return
}
when
(
SystemUtil
.
getDeviceBrand
())
{
BrandConstant
.
HUAWEI
->
{
pushSdkManager
=
PushSdkManager
(
HuaWeiPushPolicy
())
}
BrandConstant
.
OPPO
->
{
pushSdkManager
=
PushSdkManager
(
OppoPushPolicy
())
}
BrandConstant
.
VIVO
->
{
pushSdkManager
=
PushSdkManager
(
ViVoPushPolicy
())
}
BrandConstant
.
XIAOMI
->
{
pushSdkManager
=
PushSdkManager
(
MiPushPolicy
())
}
else
->
{
pushSdkManager
=
PushSdkManager
(
UmengPushPolicy
())
}
}
pushSdkManager
.
initSpecealSdk
()
}
}
Components/BPush/src/main/java/com/yidian/shenghuoquan/bpush/push/umengpush/UmengPushPolicy.kt
View file @
07eb40c2
...
@@ -11,17 +11,18 @@ import com.yidian.shenghuoquan.bpush.push.PushPolicy
...
@@ -11,17 +11,18 @@ import com.yidian.shenghuoquan.bpush.push.PushPolicy
import
timber.log.Timber
import
timber.log.Timber
class
UmengPushPolicy
:
PushPolicy
(),
IUmengRegisterCallback
{
class
UmengPushPolicy
:
PushPolicy
(),
IUmengRegisterCallback
{
val
mPushAgent
=
PushAgent
.
getInstance
(
BPushApplication
.
context
)
//
val mPushAgent = PushAgent.getInstance(BPushApplication.context)
val
messageHandler
=
object
:
UmengMessageHandler
()
{
val
messageHandler
=
object
:
UmengMessageHandler
()
{
override
fun
dealWithCustomMessage
(
p0
:
Context
?,
p1
:
UMessage
?)
{
override
fun
dealWithCustomMessage
(
p0
:
Context
?,
p1
:
UMessage
?)
{
super
.
dealWithCustomMessage
(
p0
,
p1
)
super
.
dealWithCustomMessage
(
p0
,
p1
)
//todo向其他组件提供消息
//todo向其他组件提供消息
}
}
}
}
override
fun
initPushSdk
()
{
override
fun
initPushSdk
()
{
mPushAgent
.
register
(
this
)
//
mPushAgent.register(this)
}
}
override
fun
pubMessage
(
message
:
String
)
{
override
fun
pubMessage
(
message
:
String
)
{
...
@@ -31,10 +32,31 @@ class UmengPushPolicy: PushPolicy(), IUmengRegisterCallback {
...
@@ -31,10 +32,31 @@ class UmengPushPolicy: PushPolicy(), IUmengRegisterCallback {
override
fun
onSuccess
(
p0
:
String
?)
{
override
fun
onSuccess
(
p0
:
String
?)
{
Timber
.
tag
(
"UmengPushPolicy"
).
i
(
"register success token is $p0"
)
Timber
.
tag
(
"UmengPushPolicy"
).
i
(
"register success token is $p0"
)
pushStatus
=
Constant
.
pushConnected
pushStatus
=
Constant
.
pushConnected
mPushAgent
.
messageHandler
=
messageHandler
//
mPushAgent.messageHandler = messageHandler
}
}
override
fun
onFailure
(
p0
:
String
?,
p1
:
String
?)
{
override
fun
onFailure
(
p0
:
String
?,
p1
:
String
?)
{
Timber
.
tag
(
"UmengPushPolicy"
).
i
(
"register failture p0 is $p0, p1 is $p1"
)
Timber
.
tag
(
"UmengPushPolicy"
).
i
(
"register failture p0 is $p0, p1 is $p1"
)
}
}
public
fun
initUmengPush
(
context
:
Context
)
{
val
pushAgent
:
PushAgent
=
PushAgent
.
getInstance
(
context
)
pushAgent
.
messageHandler
=
object
:
UmengMessageHandler
()
{
override
fun
dealWithCustomMessage
(
p0
:
Context
?,
p1
:
UMessage
?)
{
super
.
dealWithCustomMessage
(
p0
,
p1
)
Timber
.
tag
(
"UmengPushPolicy"
).
i
(
"custom message $p1"
)
}
}
pushAgent
.
register
(
object
:
IUmengRegisterCallback
{
override
fun
onSuccess
(
p0
:
String
?)
{
Timber
.
tag
(
"UmengPushPolicy"
).
i
(
"register success token is $p0"
)
}
override
fun
onFailure
(
p0
:
String
?,
p1
:
String
?)
{
Timber
.
tag
(
"UmengPushPolicy"
).
i
(
"register failture $p0, $p1"
)
}
})
}
}
}
Components/BPush/src/main/java/com/yidian/shenghuoquan/bpush/push/umengpush/helper/PushConstants.java
0 → 100644
View file @
07eb40c2
package
com
.
yidian
.
shenghuoquan
.
bpush
.
push
.
umengpush
.
helper
;
/**
* Sample相关的常量定义类
*/
public
class
PushConstants
{
/**
* 应用申请的Appkey
*/
// public static final String APP_KEY = "应用申请的Appkey";
public
static
final
String
APP_KEY
=
"6108ab43864a9558e6da2ba5"
;
/**
* 应用申请的UmengMessageSecret
*/
// public static final String MESSAGE_SECRET = "应用申请的UmengMessageSecret";
public
static
final
String
MESSAGE_SECRET
=
"3bebc2c01765946dbf1823f9cf4b3604"
;
/**
* 后台加密消息的密码(仅Demo用,请勿将此密码泄漏)
*/
public
static
final
String
APP_MASTER_SECRET
=
"6vnajkupxywhpgf60ndh73pbotyd8mfn"
;
/**
* 渠道名称,修改为您App的发布渠道名称
*/
public
static
final
String
CHANNEL
=
"Umeng"
;
/**
* 小米后台APP对应的xiaomi id
*/
// public static final String MI_ID = "填写您在小米后台APP对应的xiaomi id";
public
static
final
String
MI_ID
=
"2882303761517875511"
;
/**
* 小米后台APP对应的xiaomi key
*/
// public static final String MI_KEY = "填写您在小米后台APP对应的xiaomi key";
public
static
final
String
MI_KEY
=
"5961787531511"
;
/**
* 魅族后台APP对应的xiaomi id
*/
// public static final String MEI_ZU_ID = "填写您在魅族后台APP对应的app id";
public
static
final
String
MEI_ZU_ID
=
"116090"
;
/**
* 魅族后台APP对应的xiaomi key
*/
// public static final String MEI_ZU_KEY = "填写您在魅族后台APP对应的app key";
public
static
final
String
MEI_ZU_KEY
=
"9413f9968d654df092afecf4d3782391"
;
/**
* OPPO后台APP对应的app key
*/
// public static final String OPPO_KEY = "填写您在OPPO后台APP对应的app key";
public
static
final
String
OPPO_KEY
=
"c39dd561327e484bb1228b5459063022"
;
/**
* OPPO后台APP对应的app secret
*/
// public static final String OPPO_SECRET = "填写您在OPPO后台APP对应的app secret";
public
static
final
String
OPPO_SECRET
=
"a915f817673a45f08065a2236dfe85a7"
;
}
Components/BPush/src/main/java/com/yidian/shenghuoquan/bpush/push/umengpush/helper/PushHelper.java
0 → 100644
View file @
07eb40c2
package
com
.
yidian
.
shenghuoquan
.
bpush
.
push
.
umengpush
.
helper
;
import
android.content.Context
;
import
android.util.Log
;
import
com.taobao.accs.ACCSClient
;
import
com.taobao.accs.AccsClientConfig
;
import
com.taobao.agoo.TaobaoRegister
;
import
com.umeng.commonsdk.UMConfigure
;
import
com.umeng.commonsdk.utils.UMUtils
;
import
com.umeng.message.IUmengRegisterCallback
;
import
com.umeng.message.PushAgent
;
import
com.umeng.message.UTrack
;
import
com.umeng.message.UmengMessageHandler
;
import
com.umeng.message.UmengNotificationClickHandler
;
import
com.umeng.message.entity.UMessage
;
/**
* PushSDK集成帮助类
*/
public
class
PushHelper
{
private
static
final
String
TAG
=
PushHelper
.
class
.
getSimpleName
();
/**
* 预初始化,已添加子进程中初始化sdk。
* 使用场景:用户未同意隐私政策协议授权时,延迟初始化
*
* @param context 应用上下文
*/
public
static
void
preInit
(
Context
context
)
{
try
{
//解决推送消息显示乱码的问题
AccsClientConfig
.
Builder
builder
=
new
AccsClientConfig
.
Builder
();
builder
.
setAppKey
(
"umeng:"
+
PushConstants
.
APP_KEY
);
builder
.
setAppSecret
(
PushConstants
.
MESSAGE_SECRET
);
builder
.
setTag
(
AccsClientConfig
.
DEFAULT_CONFIGTAG
);
ACCSClient
.
init
(
context
,
builder
.
build
());
TaobaoRegister
.
setAccsConfigTag
(
context
,
AccsClientConfig
.
DEFAULT_CONFIGTAG
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
UMConfigure
.
preInit
(
context
,
PushConstants
.
APP_KEY
,
PushConstants
.
CHANNEL
);
if
(!
isMainProcess
(
context
))
{
init
(
context
);
}
}
/**
* 初始化。
* 场景:用户已同意隐私政策协议授权时
*
* @param context 应用上下文
*/
public
static
void
init
(
Context
context
)
{
// 在此处调用基础组件包提供的初始化函数 相应信息可在应用管理 -> 应用信息 中找到 http://message.umeng.com/list/apps
// 参数一:当前上下文context;
// 参数二:应用申请的Appkey;
// 参数三:渠道名称;
// 参数四:设备类型,必须参数,传参数为UMConfigure.DEVICE_TYPE_PHONE则表示手机;传参数为UMConfigure.DEVICE_TYPE_BOX则表示盒子;默认为手机;
// 参数五:Push推送业务的secret 填充Umeng Message Secret对应信息
UMConfigure
.
init
(
context
,
PushConstants
.
APP_KEY
,
PushConstants
.
CHANNEL
,
UMConfigure
.
DEVICE_TYPE_PHONE
,
PushConstants
.
MESSAGE_SECRET
);
//获取消息推送实例
final
PushAgent
pushAgent
=
PushAgent
.
getInstance
(
context
);
pushAdvancedFunction
(
context
);
pushAgent
.
setMessageHandler
(
new
UmengMessageHandler
()
{
@Override
public
void
dealWithCustomMessage
(
Context
context
,
UMessage
uMessage
)
{
super
.
dealWithCustomMessage
(
context
,
uMessage
);
Log
.
i
(
">>>>>>>>>>>>>>"
,
"message is "
+
uMessage
);
}
});
//注册推送服务,每次调用register方法都会回调该接口
pushAgent
.
register
(
new
IUmengRegisterCallback
()
{
@Override
public
void
onSuccess
(
String
deviceToken
)
{
//注册成功会返回deviceToken deviceToken是推送消息的唯一标志
Log
.
i
(
TAG
,
"deviceToken --> "
+
deviceToken
);
//可设置别名,推送时使用别名推送
String
type
=
"uid"
;
String
alias
=
"123456"
;
pushAgent
.
setAlias
(
alias
,
type
,
new
UTrack
.
ICallBack
()
{
@Override
public
void
onMessage
(
boolean
success
,
String
message
)
{
Log
.
i
(
TAG
,
"setAlias "
+
success
+
" msg:"
+
message
);
}
});
}
@Override
public
void
onFailure
(
String
errCode
,
String
errDesc
)
{
Log
.
e
(
TAG
,
"register failure:--> "
+
"code:"
+
errCode
+
",desc:"
+
errDesc
);
}
});
if
(
isMainProcess
(
context
))
{
registerDeviceChannel
(
context
);
}
}
/**
* 注册设备推送通道(小米、华为等设备的推送)
*
* @param context 应用上下文
*/
private
static
void
registerDeviceChannel
(
Context
context
)
{
//小米通道,填写您在小米后台APP对应的xiaomi id和key
/*MiPushRegistar.register(context, PushConstants.MI_ID, PushConstants.MI_KEY);
//华为,注意华为通道的初始化参数在minifest中配置
HuaWeiRegister.register((Application) context.getApplicationContext());
//魅族,填写您在魅族后台APP对应的app id和key
MeizuRegister.register(context, PushConstants.MEI_ZU_ID, PushConstants.MEI_ZU_KEY);
//OPPO,填写您在OPPO后台APP对应的app key和secret
OppoRegister.register(context, PushConstants.OPPO_KEY, PushConstants.OPPO_SECRET);
//vivo,注意vivo通道的初始化参数在minifest中配置
VivoRegister.register(context);*/
}
/**
* 是否运行在主进程
*
* @param context 应用上下文
* @return true: 主进程;false: 子进程
*/
public
static
boolean
isMainProcess
(
Context
context
)
{
return
UMUtils
.
isMainProgress
(
context
);
}
//推送高级功能集成说明
private
static
void
pushAdvancedFunction
(
Context
context
)
{
PushAgent
pushAgent
=
PushAgent
.
getInstance
(
context
);
//设置通知栏显示通知的最大个数(0~10),0:不限制个数
pushAgent
.
setDisplayNotificationNumber
(
0
);
//推送消息处理
UmengMessageHandler
msgHandler
=
new
UmengMessageHandler
()
{
//处理通知栏消息
@Override
public
void
dealWithNotificationMessage
(
Context
context
,
UMessage
msg
)
{
super
.
dealWithNotificationMessage
(
context
,
msg
);
Log
.
i
(
TAG
,
"notification receiver:"
+
msg
.
getRaw
().
toString
());
}
//处理透传消息
@Override
public
void
dealWithCustomMessage
(
Context
context
,
UMessage
msg
)
{
super
.
dealWithCustomMessage
(
context
,
msg
);
Log
.
i
(
TAG
,
"custom receiver:"
+
msg
.
getRaw
().
toString
());
}
};
pushAgent
.
setMessageHandler
(
msgHandler
);
//推送消息点击处理
UmengNotificationClickHandler
notificationClickHandler
=
new
UmengNotificationClickHandler
()
{
@Override
public
void
openActivity
(
Context
context
,
UMessage
msg
)
{
super
.
openActivity
(
context
,
msg
);
Log
.
i
(
TAG
,
"click openActivity: "
+
msg
.
getRaw
().
toString
());
}
@Override
public
void
launchApp
(
Context
context
,
UMessage
msg
)
{
super
.
launchApp
(
context
,
msg
);
Log
.
i
(
TAG
,
"click launchApp: "
+
msg
.
getRaw
().
toString
());
}
@Override
public
void
dismissNotification
(
Context
context
,
UMessage
msg
)
{
super
.
dismissNotification
(
context
,
msg
);
Log
.
i
(
TAG
,
"click dismissNotification: "
+
msg
.
getRaw
().
toString
());
}
};
pushAgent
.
setNotificationClickHandler
(
notificationClickHandler
);
}
}
Components/BPush/src/main/java/com/yidian/shenghuoquan/bpush/service/PushService.kt
View file @
07eb40c2
package
com.yidian.shenghuoquan.bpush.service
package
com.yidian.shenghuoquan.bpush.service
import
com.yidian.bcommon.services.ZapServiceActionConstants
import
com.yidian.bcommon.services.ZapServiceActionConstants
import
com.yidian.shenghuoquan.bpush.app.BPushApplication
import
com.yidian.shenghuoquan.bpush.base.BPush
import
com.yidian.shenghuoquan.bpush.constant.BrandConstant
import
com.yidian.shenghuoquan.bpush.constant.BrandConstant
import
com.yidian.shenghuoquan.bpush.constant.Constant
import
com.yidian.shenghuoquan.bpush.constant.Constant
import
com.yidian.shenghuoquan.bpush.push.*
import
com.yidian.shenghuoquan.bpush.push.*
...
@@ -26,28 +28,7 @@ class PushService : ZapService() {
...
@@ -26,28 +28,7 @@ class PushService : ZapService() {
when
(
action
)
{
when
(
action
)
{
ZapServiceActionConstants
.
ActionPushMessage
->
pushMessage
(
params
.
toString
())
ZapServiceActionConstants
.
ActionPushMessage
->
pushMessage
(
params
.
toString
())
ZapServiceActionConstants
.
ActionInitPushService
->
{
ZapServiceActionConstants
.
ActionInitPushService
->
{
if
(
this
::
pushSdkManager
.
isInitialized
&&
pushSdkManager
.
pushStatus
()
==
Constant
.
pushConnected
)
{
Timber
.
tag
(
TAG
).
i
(
"push sdk has initiallized"
)
return
}
when
(
SystemUtil
.
getDeviceBrand
())
{
BrandConstant
.
HUAWEI
->
{
pushSdkManager
=
PushSdkManager
(
HuaWeiPushPolicy
())
}
BrandConstant
.
OPPO
->
{
pushSdkManager
=
PushSdkManager
(
OppoPushPolicy
())
}
BrandConstant
.
VIVO
->
{
pushSdkManager
=
PushSdkManager
(
ViVoPushPolicy
())
}
BrandConstant
.
XIAOMI
->
{
pushSdkManager
=
PushSdkManager
(
MiPushPolicy
())
}
else
->
{
pushSdkManager
=
PushSdkManager
(
UmengPushPolicy
())
}
}
pushSdkManager
.
initSpecealSdk
()
}
}
}
}
}
}
...
...
Components/BPush/src/main/jni/push-sdk-so.zip
deleted
100644 → 0
View file @
d8853347
File deleted
Components/BRoot/src/main/java/com/yidian/shenghuoquan/broot/BaseInitConfig.kt
View file @
07eb40c2
...
@@ -34,7 +34,7 @@ object BaseInitConfig {
...
@@ -34,7 +34,7 @@ object BaseInitConfig {
fun
performInitialization
(
context
:
Context
)
{
fun
performInitialization
(
context
:
Context
)
{
// 初始化友盟
// 初始化友盟
UMConfigUtils
.
init
(
context
)
//
UMConfigUtils.init(context)
if
(
ProcessUtil
.
isMainProcess
(
context
))
{
if
(
ProcessUtil
.
isMainProcess
(
context
))
{
FtDeviceFingerManager
.
init
(
context
)
FtDeviceFingerManager
.
init
(
context
)
initXBridManager
(
context
)
initXBridManager
(
context
)
...
...
Components/BSetting/src/main/java/com/yidian/shenghuoquan/bsetting/ui/login/LoginLifeCircleActivity.kt
View file @
07eb40c2
...
@@ -156,6 +156,9 @@ class LoginLifeCircleActivity : BaseActivity<ActivityLoginBinding>(), View.OnFoc
...
@@ -156,6 +156,9 @@ class LoginLifeCircleActivity : BaseActivity<ActivityLoginBinding>(), View.OnFoc
}
}
private
fun
changeLoginButtonStatus
()
{
private
fun
changeLoginButtonStatus
()
{
ZapTicket
(
ZapServiceNameConstants
.
BPush
)
.
withAction
(
ZapServiceActionConstants
.
ActionInitPushService
)
.
ship
()
if
(
mobileFinish
&&
codeFinish
&&
protocolAgree
)
{
if
(
mobileFinish
&&
codeFinish
&&
protocolAgree
)
{
setLoginButtonStatus
(
true
)
setLoginButtonStatus
(
true
)
}
else
{
}
else
{
...
...
app/agconnect-services.json
View file @
07eb40c2
...
@@ -17,21 +17,21 @@
...
@@ -17,21 +17,21 @@
},
},
"client"
:{
"client"
:{
"cp_id"
:
"890086000102168665"
,
"cp_id"
:
"890086000102168665"
,
"product_id"
:
"
9105385871707778800
"
,
"product_id"
:
"
736430079245904749
"
,
"client_id"
:
"
254140377525650560
"
,
"client_id"
:
"
684631289411667136
"
,
"client_secret"
:
"
845AA515AB73EAEFE2B04C8BEA43DA3CD7066D80CFD88B8F5689CDEB433E2EFA
"
,
"client_secret"
:
"
11430A004CC57F69194ACDD1347A22AC9D7FAA4BFC0966835B03F64CE8B6AF9D
"
,
"project_id"
:
"
9105385871707778800
"
,
"project_id"
:
"
736430079245904749
"
,
"app_id"
:
"10
0832127
"
,
"app_id"
:
"10
4583269
"
,
"api_key"
:
"CgB6e3x9
1aVnWSyaXpUQXKzeXMdIY3IBg2jTkyM3snNY2TpiX8uTt3GgNgQMovkEJNqS+Ffi7wnreLAmKVvFm42v
"
,
"api_key"
:
"CgB6e3x9
83fb94ztnIUU26WxI4mW+DF5qeIDQ34IyUvrzkTQmpTE6WMsMeIqW2pfHjuniciMTkDO84D49g4nLRE+
"
,
"package_name"
:
"
org.secuso.mindmap
"
"package_name"
:
"
com.shenghuoquan.business.debug
"
},
},
"oauth_client"
:{
"oauth_client"
:{
"client_id"
:
"10
0832127
"
,
"client_id"
:
"10
4583269
"
,
"client_type"
:
1
"client_type"
:
1
},
},
"app_info"
:{
"app_info"
:{
"app_id"
:
"10
0832127
"
,
"app_id"
:
"10
4583269
"
,
"package_name"
:
"
org.secuso.mindmap
"
"package_name"
:
"
com.shenghuoquan.business.debug
"
},
},
"service"
:{
"service"
:{
"analytics"
:{
"analytics"
:{
...
@@ -53,17 +53,17 @@
...
@@ -53,17 +53,17 @@
"configuration_version"
:
"3.0"
,
"configuration_version"
:
"3.0"
,
"appInfos"
:[
"appInfos"
:[
{
{
"package_name"
:
"
org.secuso.mindmap
"
,
"package_name"
:
"
com.shenghuoquan.business.debug
"
,
"client"
:{
"client"
:{
"app_id"
:
"10
0832127
"
"app_id"
:
"10
4583269
"
},
},
"app_info"
:{
"app_info"
:{
"package_name"
:
"
org.secuso.mindmap
"
,
"package_name"
:
"
com.shenghuoquan.business.debug
"
,
"app_id"
:
"10
0832127
"
"app_id"
:
"10
4583269
"
},
},
"oauth_client"
:{
"oauth_client"
:{
"client_type"
:
1
,
"client_type"
:
1
,
"client_id"
:
"10
0832127
"
"client_id"
:
"10
4583269
"
}
}
}
}
]
]
...
...
app/src/main/AndroidManifest.xml
View file @
07eb40c2
...
@@ -87,7 +87,7 @@
...
@@ -87,7 +87,7 @@
android:theme=
"@style/Theme.AppCompat.Light.NoActionBar"
android:theme=
"@style/Theme.AppCompat.Light.NoActionBar"
tools:replace=
"android:theme"
/>
tools:replace=
"android:theme"
/>
<!-- 以下为
友盟推送基本配置信息
start-->
<!-- 以下为
基本配置信息,需要自行添加至您的AndroidManifest文件中
start-->
<service
<service
android:name=
"com.taobao.accs.ChannelService"
android:name=
"com.taobao.accs.ChannelService"
android:exported=
"true"
android:exported=
"true"
...
@@ -177,7 +177,7 @@
...
@@ -177,7 +177,7 @@
android:exported=
"true"
android:exported=
"true"
android:process=
":channel"
>
android:process=
":channel"
>
<intent-filter>
<intent-filter>
<action
android:name=
"
com.yidian.subway
.intent.action.COMMAND"
/>
<action
android:name=
"
${applicationId}
.intent.action.COMMAND"
/>
</intent-filter>
</intent-filter>
<intent-filter>
<intent-filter>
<action
android:name=
"android.intent.action.PACKAGE_REMOVED"
/>
<action
android:name=
"android.intent.action.PACKAGE_REMOVED"
/>
...
@@ -185,7 +185,6 @@
...
@@ -185,7 +185,6 @@
</intent-filter>
</intent-filter>
</receiver>
</receiver>
<service
<service
android:name=
"com.umeng.message.UmengMessageIntentReceiverService"
android:name=
"com.umeng.message.UmengMessageIntentReceiverService"
android:exported=
"true"
android:exported=
"true"
...
@@ -220,20 +219,18 @@
...
@@ -220,20 +219,18 @@
</intent-filter>
</intent-filter>
</service>
</service>
<service
<service
android:name=
"com.umeng.message.UmengDownloadResourceService"
android:name=
"com.umeng.message.UmengDownloadResourceService"
android:exported=
"false"
android:exported=
"false"
android:permission=
"android.permission.BIND_JOB_SERVICE"
/>
android:permission=
"android.permission.BIND_JOB_SERVICE"
/>
<!--此处注意下包名💊-->
<provider
<!-- <provider-->
android:name=
"com.umeng.message.provider.MessageProvider"
<!-- android:name="com.umeng.message.provider.MessageProvider"-->
android:authorities=
"${applicationId}.umeng.message"
<!-- android:authorities="${application_id}.umeng.message"-->
android:exported=
"false"
>
<!-- android:exported="false">-->
<grant-uri-permission
android:pathPattern=
".*"
/>
<!-- <grant-uri-permission android:pathPattern=".*" />-->
</provider>
<!-- </provider>-->
<!-- 以下为基本配置信息,需要自行添加至您的AndroidManifest文件中 end-->
<!-- 以上为友盟推送基本配置信息 end-->
</application>
</application>
...
...
app/src/main/java/com/shenghuoquan/business/BusinessApplication.kt
View file @
07eb40c2
...
@@ -5,6 +5,7 @@ import android.content.Context
...
@@ -5,6 +5,7 @@ import android.content.Context
import
android.content.res.Configuration
import
android.content.res.Configuration
import
android.os.Bundle
import
android.os.Bundle
import
com.orhanobut.hawk.Hawk
import
com.orhanobut.hawk.Hawk
import
com.umeng.commonsdk.UMConfigure
import
com.yidian.bcommon.app.YdBaseApplication
import
com.yidian.bcommon.app.YdBaseApplication
import
com.yidian.bcommon.http.ApiSaveCookiesInterceptor
import
com.yidian.bcommon.http.ApiSaveCookiesInterceptor
import
com.yidian.bcommon.http.ApiSetCookiesInterceptor
import
com.yidian.bcommon.http.ApiSetCookiesInterceptor
...
@@ -12,10 +13,11 @@ import com.yidian.bcommon.services.AppUpgradeService
...
@@ -12,10 +13,11 @@ import com.yidian.bcommon.services.AppUpgradeService
import
com.yidian.bcommon.services.ImageService
import
com.yidian.bcommon.services.ImageService
import
com.yidian.bcommon.services.XEventService
import
com.yidian.bcommon.services.XEventService
import
com.yidian.bcommon.services.XPageService
import
com.yidian.bcommon.services.XPageService
import
com.yidian.bcommon.utils.UMConfigUtils
import
com.yidian.commonutil.CommonUtilLifecycleModule
import
com.yidian.commonutil.CommonUtilLifecycleModule
import
com.yidian.http.ServiceFactory
import
com.yidian.http.ServiceFactory
import
com.yidian.news.util.ProcessUtil
import
com.yidian.news.util.ProcessUtil
import
com.yidian.shenghuoquan.bpush.base.BPush
import
com.yidian.shenghuoquan.bpush.push.umengpush.helper.PushHelper
import
com.yidian.xpage.XPageManager
import
com.yidian.xpage.XPageManager
import
com.yidian.yac.core.core.YacAppSpec
import
com.yidian.yac.core.core.YacAppSpec
import
com.yidian.yac.core.zap.Zap
import
com.yidian.yac.core.zap.Zap
...
@@ -38,8 +40,8 @@ class BusinessApplication : YdBaseApplication() {
...
@@ -38,8 +40,8 @@ class BusinessApplication : YdBaseApplication() {
XPageManager
.
init
(
this
)
XPageManager
.
init
(
this
)
loadService
()
loadService
()
registerActivityLifecycleCallbacks
(
activityLifecycle
)
registerActivityLifecycleCallbacks
(
activityLifecycle
)
UMConfigUtils
.
preInit
(
context
)
}
}
// BPush().init(this)
}
}
override
fun
attachBaseContext
(
base
:
Context
?)
{
override
fun
attachBaseContext
(
base
:
Context
?)
{
...
@@ -121,4 +123,5 @@ class BusinessApplication : YdBaseApplication() {
...
@@ -121,4 +123,5 @@ class BusinessApplication : YdBaseApplication() {
Zap
.
addService
(
ImageService
.
SERVICE_NAME
,
ImageService
())
Zap
.
addService
(
ImageService
.
SERVICE_NAME
,
ImageService
())
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment