【问题标题】:huawei push kit: getToken return unknown error code华为推送包:getToken返回未知错误码
【发布时间】:2021-09-03 04:11:06
【问题描述】:

当我尝试使用getToken方法时,它返回907122050错误码,这是什么意思?

    try {
      token = HmsInstanceId.getInstance(context).getToken(appId, defaultScope);
    } catch (ApiException e) {
      CoreLogger.e("getToken error: " + e.getStatusCode());
    }

【问题讨论】:

    标签: push-notification huawei-mobile-services huawei-push-notification


    【解决方案1】:

    根据Docs.

    结果码907122050表示该操作不能在主线程中执行。方法需要在子线程中创建。

    解决方案:需要创建一个线程并在新线程中调用特定的方法。

    【讨论】:

      猜你喜欢
      • 2022-11-28
      • 1970-01-01
      • 2021-01-03
      • 1970-01-01
      • 2019-06-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多