简体   繁体   中英

Huawei push kit: stuck at push kit initializing, try again later

I'm trying to use Huawei push kit and after updating the HMS following error was thrown when trying to send upstream data.

Some configs:

  • Device: Samsung Galaxy A40 + HMS Core installed 5.0.2.301

Libraries:

  • implementation("com.huawei.hms:push:5.0.2.300")
  • implementation("com.huawei.agconnect:agconnect-core:1.4.1.300")

AGConnect: classpath 'com.huawei.agconnect:agcp:1.4.1.300'

Calling the code:

val messaging = HmsMessaging.getInstance(this.applicationContext)
messaging.send(
  RemoteMessage.Builder("push.hcm.upstream")
    .setMessageId("Message#${System.currentTimeMillis()}")
    .setData(data)
    .build()
)

Causes this error:

java.lang.UnsupportedOperationException: push kit initializing, try again later
        at com.huawei.hms.push.HmsMessaging.a(HmsMessaging.java:212)
        at com.huawei.hms.push.HmsMessaging.send(HmsMessaging.java:204)
        at ir.malv.plusdependencytest.MainActivity$initializeListStuff$1$15.invoke(MainActivity.kt:355) // related to the code I called
        at ir.malv.plusdependencytest.MainActivity$initializeListStuff$1$15.invoke(MainActivity.kt:43)
        at ir.malv.plusdependencytest.UtilsKt$input$2.onClick(Utils.kt:47)
        at androidx.appcompat.app.AlertController$ButtonHandler.handleMessage(AlertController.java:167)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:237)
        at android.app.ActivityThread.main(ActivityThread.java:7948)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1075)

And it just remains "initializing".

Note that the library used to work with a previous version of HMS core , so neither Phone or Process of Push on no-Huawei can be the reason.

问题似乎是由于IP 限制,并在最新版本的Hms-Core后解决。

尝试在设置中强制停止 HMS 核心

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM