Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
P
PushPlatformDemo
Project
Project
Details
Activity
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
pengjunjing
PushPlatformDemo
Commits
5dc57a73
Commit
5dc57a73
authored
May 25, 2021
by
pengjunjign
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add:新增别名功能,新增主题订阅
parent
5d7c0a19
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
24 deletions
+13
-24
MainActivity.kt
app/src/main/java/com/laihua/pushtestproject/MainActivity.kt
+1
-1
MyApplication.kt
...src/main/java/com/laihua/pushtestproject/MyApplication.kt
+12
-23
No files found.
app/src/main/java/com/laihua/pushtestproject/MainActivity.kt
View file @
5dc57a73
...
...
@@ -8,6 +8,6 @@ class MainActivity : AppCompatActivity() {
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
setContentView
(
R
.
layout
.
activity_main
)
//
Toast.makeText(this,""+ Test.teststr,Toast.LENGTH_SHORT).show()
//
PushManager.instance.
}
}
\ No newline at end of file
app/src/main/java/com/laihua/pushtestproject/MyApplication.kt
View file @
5dc57a73
...
...
@@ -15,31 +15,20 @@ class MyApplication : Application() {
override
fun
onCreate
()
{
super
.
onCreate
()
PushManager
.
instance
.
initContext
(
this
)
PushManager
.
instance
.
initMiPush
(
InitParam
(
"2882303761519924093"
,
"5121992433093"
),
{
LogUtils
.
i
(
"小米推送SDK初始化成功:$it"
)
},
{
LogUtils
.
i
(
"小米推送SDK初始化失败:${it.message}"
)
})
PushManager
.
instance
.
initHmsPush
(
{
LogUtils
.
i
(
"华为推送SDK初始化成功:$it"
)
},
{
LogUtils
.
i
(
"华为推送SDK初始化失败:${it.message}"
)
})
//vivo的配置信息直接在manifest配置,华为的配置信息在agconnect-services.json文件
val
autoInitPushSdk
=
PushManager
.
instance
.
autoInitPushSdk
(
//OPPO APPID 30532383
PushManager
.
instance
.
initOppoPush
(
InitParam
(
"220c8dc643ce4a709b116a0aa26e6bf4"
,
"0305238c1c6949c38caa1fdd8070b4aa"
),
{
LogUtils
.
i
(
"OPPO推送SDK初始化成功:$it"
)
},
{
LogUtils
.
i
(
"OPPO推送SDK初始化失败:${it.message}"
)
}
)
PushManager
.
instance
.
initFlyMe
(
InitParam
(
"2882303761519924093"
,
"5121992433093"
),
InitParam
(
"141361"
,
"f3e78d580c7d46c295263b3dde94ca72"
),
{
LogUtils
.
i
(
"Flyme推送SDK初始化成功:$it"
)
},
{
LogUtils
.
i
(
"Flyme推送SDK初始化失败:${it.message}"
)
})
//vivo的配置信息直接在manifest配置
PushManager
.
instance
.
initVivo
(
{
LogUtils
.
i
(
"VIVO推送SDK初始化成功:$it"
)
},
{
LogUtils
.
i
(
"VIVO推送SDK初始化失败:${it.message}"
)
})
{
LogUtils
.
i
(
"推送SDK初始化成功:$it"
)
PushManager
.
instance
.
addTopic
(
"test_topic"
)
PushManager
.
instance
.
setAlias
(
"test_alias"
)
},
{
LogUtils
.
i
(
"推送SDK初始化失败:${it.message}"
)
}
)
LogUtils
.
i
(
"所使用的推送渠道为${autoInitPushSdk}"
)
}
}
\ No newline at end of file
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