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
a356816c
Commit
a356816c
authored
Jul 29, 2021
by
chengkun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
默认情况下初始化友盟sdk
parent
1b694242
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
6 deletions
+34
-6
OppoPushPolicy.kt
...yidian/shenghuoquan/bpush/push/oppopush/OppoPushPolicy.kt
+3
-2
UmengPushPolicy.kt
...dian/shenghuoquan/bpush/push/umengpush/UmengPushPolicy.kt
+30
-3
PushService.kt
...java/com/yidian/shenghuoquan/bpush/service/PushService.kt
+1
-1
push-sdk-so.zip
Components/BPush/src/main/jni/push-sdk-so.zip
+0
-0
No files found.
Components/BPush/src/main/java/com/yidian/shenghuoquan/bpush/push/oppopush/OppoPushPolicy.kt
View file @
a356816c
...
@@ -13,12 +13,13 @@ class OppoPushPolicy: PushPolicy(), ICallBackResultService {
...
@@ -13,12 +13,13 @@ class OppoPushPolicy: PushPolicy(), ICallBackResultService {
}
}
override
fun
initPushSdk
()
{
override
fun
initPushSdk
()
{
Timber
.
tag
(
"OppoPushPolicy"
).
i
(
"Oppo push sdk init"
)
Timber
.
tag
(
"OppoPushPolicy"
).
i
(
"Oppo push sdk init"
)
HeytapPushManager
.
init
(
BPushApplication
.
context
,
true
);
if
(
HeytapPushManager
.
isSupportPush
())
{
if
(
HeytapPushManager
.
isSupportPush
())
{
HeytapPushManager
.
init
(
BPushApplication
.
context
,
true
);
HeytapPushManager
.
register
(
BPushApplication
.
context
,
appKey
,
appSecret
,
this
)
}
else
{
}
else
{
Timber
.
tag
(
"OppoPushPolicy"
).
i
(
"not support oppo push"
)
Timber
.
tag
(
"OppoPushPolicy"
).
i
(
"not support oppo push"
)
return
}
}
HeytapPushManager
.
register
(
BPushApplication
.
context
,
appKey
,
appSecret
,
this
)
}
}
override
fun
pubMessage
(
message
:
String
)
{
override
fun
pubMessage
(
message
:
String
)
{
...
...
Components/BPush/src/main/java/com/yidian/shenghuoquan/bpush/push/umengpush/UmengPushPolicy.kt
View file @
a356816c
package
com.yidian.shenghuoquan.bpush.push.umengpush
package
com.yidian.shenghuoquan.bpush.push.umengpush
import
android.content.Context
import
com.umeng.message.IUmengRegisterCallback
import
com.umeng.message.PushAgent
import
com.umeng.message.UmengMessageHandler
import
com.umeng.message.entity.UMessage
import
com.yidian.shenghuoquan.bpush.app.BPushApplication
import
com.yidian.shenghuoquan.bpush.constant.Constant
import
com.yidian.shenghuoquan.bpush.push.PushPolicy
import
com.yidian.shenghuoquan.bpush.push.PushPolicy
import
timber.log.Timber
class
UmengPushPolicy
:
PushPolicy
(),
IUmengRegisterCallback
{
val
mPushAgent
=
PushAgent
.
getInstance
(
BPushApplication
.
context
)
val
messageHandler
=
object
:
UmengMessageHandler
()
{
override
fun
dealWithCustomMessage
(
p0
:
Context
?,
p1
:
UMessage
?)
{
super
.
dealWithCustomMessage
(
p0
,
p1
)
//todo向其他组件提供消息
}
}
class
UmengPushPolicy
:
PushPolicy
()
{
override
fun
initPushSdk
()
{
override
fun
initPushSdk
()
{
TODO
(
"Not yet implemented"
)
mPushAgent
.
register
(
this
)
}
}
override
fun
pubMessage
(
message
:
String
)
{
override
fun
pubMessage
(
message
:
String
)
{
TODO
(
"Not yet implemented"
)
}
override
fun
onSuccess
(
p0
:
String
?)
{
Timber
.
tag
(
"UmengPushPolicy"
).
i
(
"register success token is $p0"
)
pushStatus
=
Constant
.
pushConnected
mPushAgent
.
messageHandler
=
messageHandler
}
override
fun
onFailure
(
p0
:
String
?,
p1
:
String
?)
{
Timber
.
tag
(
"UmengPushPolicy"
).
i
(
"register failture p0 is $p0, p1 is $p1"
)
}
}
}
}
Components/BPush/src/main/java/com/yidian/shenghuoquan/bpush/service/PushService.kt
View file @
a356816c
...
@@ -30,7 +30,7 @@ class PushService : ZapService() {
...
@@ -30,7 +30,7 @@ class PushService : ZapService() {
Timber
.
tag
(
TAG
).
i
(
"push sdk has initiallized"
)
Timber
.
tag
(
TAG
).
i
(
"push sdk has initiallized"
)
return
return
}
}
when
(
SystemUtil
.
getDeviceBrand
()
)
{
when
(
"55555"
/*SystemUtil.getDeviceBrand()*/
)
{
BrandConstant
.
HUAWEI
->
{
BrandConstant
.
HUAWEI
->
{
pushSdkManager
=
PushSdkManager
(
HuaWeiPushPolicy
())
pushSdkManager
=
PushSdkManager
(
HuaWeiPushPolicy
())
}
}
...
...
Components/BPush/src/main/jni/push-sdk-so.zip
0 → 100644
View file @
a356816c
File added
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