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
8e515262
Commit
8e515262
authored
Jul 28, 2021
by
chengkun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add oppo push sdk
parent
a8ab985a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
70 additions
and
12 deletions
+70
-12
build.gradle
Components/BPush/build.gradle
+6
-0
com.heytap.msp.aar
Components/BPush/libs/com.heytap.msp.aar
+0
-0
AndroidManifest.xml
Components/BPush/src/main/AndroidManifest.xml
+25
-6
MiPushPolicy.kt
...com/yidian/shenghuoquan/bpush/push/mipush/MiPushPolicy.kt
+3
-3
OppoPushPolicy.kt
...yidian/shenghuoquan/bpush/push/oppopush/OppoPushPolicy.kt
+36
-3
No files found.
Components/BPush/build.gradle
View file @
8e515262
...
...
@@ -52,6 +52,12 @@ android {
kapt
{
generateStubs
=
true
}
repositories
{
flatDir
{
dirs
'libs'
}
}
}
dependencies
{
...
...
Components/BPush/libs/com.heytap.msp.aar
0 → 100644
View file @
8e515262
File added
Components/BPush/src/main/AndroidManifest.xml
View file @
8e515262
...
...
@@ -7,21 +7,20 @@
<uses-permission
android:name=
"android.permission.ACCESS_WIFI_STATE"
/>
<uses-permission
android:name=
"android.permission.READ_PHONE_STATE"
/>
<uses-permission
android:name=
"android.permission.VIBRATE"
/>
<!--oppo 推送权限-->
<uses-permission
android:name=
"com.coloros.mcs.permission.RECIEVE_MCS_MESSAGE"
/>
<uses-permission
android:name=
"com.heytap.mcs.permission.RECIEVE_MCS_MESSAGE"
/>
<permission
android:name=
"com.shenghuoquan.business.permission.MIPUSH_RECEIVE"
android:protectionLevel=
"signature"
/>
<uses-permission
android:name=
"com.shenghuoquan.business.permission.MIPUSH_RECEIVE"
/>
<application>
<!--小米推送服务-->
<receiver
android:name=
".push.mipush.receiver.MiPushReceiver"
android:enabled=
"true"
android:exported=
"true"
>
</receiver>
<service
android:name=
"com.xiaomi.push.service.XMPushService"
android:enabled=
"true"
...
...
@@ -39,7 +38,6 @@
<service
android:name=
"com.xiaomi.mipush.sdk.MessageHandleService"
android:enabled=
"true"
/>
<receiver
android:name=
"com.xiaomi.push.service.receivers.NetworkStatusReceiver"
android:exported=
"true"
>
...
...
@@ -57,6 +55,27 @@
<action
android:name=
"com.xiaomi.push.PING_TIMER"
/>
</intent-filter>
</receiver>
<!--oppo 推送-->
<service
android:name=
"com.heytap.msp.push.service.CompatibleDataMessageCallbackService"
android:permission=
"com.coloros.mcs.permission.SEND_MCS_MESSAGE"
>
<intent-filter>
<action
android:name=
"com.coloros.mcs.action.RECEIVE_MCS_MESSAGE"
/>
</intent-filter>
</service>
<!--兼容Q以下版本-->
<service
android:name=
"com.heytap.msp.push.service.DataMessageCallbackService"
android:permission=
"com.heytap.mcs.permission.SEND_PUSH_MESSAGE"
>
<intent-filter>
<action
android:name=
"com.heytap.mcs.action.RECEIVE_MCS_MESSAGE"
/>
<action
android:name=
"com.heytap.msp.push.RECEIVE_MCS_MESSAGE"
/>
</intent-filter>
</service>
<!--兼容Q版本-->
</application>
</manifest>
\ No newline at end of file
Components/BPush/src/main/java/com/yidian/shenghuoquan/bpush/push/mipush/MiPushPolicy.kt
View file @
8e515262
...
...
@@ -9,9 +9,9 @@ import com.yidian.shenghuoquan.bpush.push.PushPolicy
class
MiPushPolicy
:
PushPolicy
{
companion
object
{
const
val
appId
=
""
const
val
appkey
=
""
const
val
packageName
=
""
const
val
appId
=
"
2882300000000000000
"
const
val
appkey
=
"
'5871990645361
"
const
val
packageName
=
"
com.shenghuoquan.business
"
}
override
fun
initPushSdk
()
{
if
(
shouldInit
())
{
...
...
Components/BPush/src/main/java/com/yidian/shenghuoquan/bpush/push/oppopush/OppoPushPolicy.kt
View file @
8e515262
package
com.yidian.shenghuoquan.bpush.push.oppopush
import
com.heytap.msp.push.HeytapPushManager
import
com.heytap.msp.push.callback.ICallBackResultService
import
com.yidian.shenghuoquan.bpush.app.BPushApplication
import
com.yidian.shenghuoquan.bpush.push.PushPolicy
import
timber.log.Timber
class
OppoPushPolicy
:
PushPolicy
{
class
OppoPushPolicy
:
PushPolicy
,
ICallBackResultService
{
companion
object
{
const
val
appKey
=
"d4553310f4704936bb48f2d1e5f7da22"
const
val
appSecret
=
"31e239f66ce64309afd65e627fe44cf0"
}
override
fun
initPushSdk
()
{
TODO
(
"Not yet implemented"
)
if
(
HeytapPushManager
.
isSupportPush
())
{
HeytapPushManager
.
init
(
BPushApplication
.
context
,
true
);
}
else
{
Timber
.
tag
(
"OppoPushPolicy"
).
i
(
"not support oppo push"
)
}
HeytapPushManager
.
register
(
BPushApplication
.
context
,
appKey
,
appSecret
,
this
)
}
override
fun
pubMessage
(
message
:
String
)
{
TODO
(
"Not yet implemented"
)
Timber
.
tag
(
"OppoPushPolicy"
).
i
(
"message is $message"
)
}
override
fun
onRegister
(
code
:
Int
,
regId
:
String
?)
{
Timber
.
tag
(
"OppoPushPolicy"
).
i
(
"register id is $regId"
)
}
override
fun
onUnRegister
(
code
:
Int
)
{
Timber
.
tag
(
"OppoPushPolicy"
).
i
(
"unrgister result code is $code"
)
}
override
fun
onSetPushTime
(
code
:
Int
,
s
:
String
?)
{
Timber
.
tag
(
"OppoPushPolicy"
).
i
(
"code is $code, s is $s"
)
}
override
fun
onGetPushStatus
(
code
:
Int
,
status
:
Int
)
{
Timber
.
tag
(
"OppoPushPolicy"
).
i
(
"code is $code, status is $status"
)
}
override
fun
onGetNotificationStatus
(
code
:
Int
,
status
:
Int
)
{
Timber
.
tag
(
"OppoPushPolicy"
).
i
(
"code is $code, status is $status"
)
}
}
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