Commit 5dc57a73 authored by pengjunjign's avatar pengjunjign

add:新增别名功能,新增主题订阅

parent 5d7c0a19
......@@ -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
......@@ -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}") })
//OPPO APPID 30532383
PushManager.instance.initOppoPush(
//vivo的配置信息直接在manifest配置,华为的配置信息在agconnect-services.json文件
val autoInitPushSdk = PushManager.instance.autoInitPushSdk(
//OPPO APPID 30532383
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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment