Kostya Vasilyev
Kostya Vasilyev

Reputation: 864

ApiException: 907122036: no right

I'm trying to create a special version of my app for Huawei App Gallery, this means replacing Firebase Cloud Messaging with Huawei Push Kit.

My app's failing to obtain a token with this exception:

I HMSSDK_HmsClient: receive msg status_code:0, error_code800100000, api_name:push.gettoken, app_id:102999567|, pkg_name:org.kman.test1.huawei, session_id:*, transaction_id:102999567ttoken20201001165618936966550, resolution:null
E HMSSDK_HmsInstanceIdEx: TokenTask failed, ErrorCode: 800100000
E HMSSDK_AutoInit: Push init failed
E HMSSDK_AutoInit: com.huawei.hms.common.ApiException: 907122036: no right
E HMSSDK_AutoInit:       at com.huawei.hms.opendevice.a.a(ErrorEnum.java:272)
E HMSSDK_AutoInit:       at com.huawei.hms.opendevice.k.doExecute(GetTokenTask.java:58)
E HMSSDK_AutoInit:       at com.huawei.hms.opendevice.k.doExecute(GetTokenTask.java:34)
E HMSSDK_AutoInit:       at com.huawei.hms.common.internal.TaskApiCall.onResponse(TaskApiCall.java:190)

According to Huawei documentation, this error ("no right") means that Push Kit is not enabled for the project. However it is enabled, I just checked.

I ran into this with my main work project where I'm adding AG support and also same exact issue with a small test app.

Main work project App ID: 102982583 Package: org.kman.skymail.huawei

Small test project App ID: 102999567 Package: org.kman.test1.huawei

I have done all (it seems) the other steps: adding agconnect-services.json, enabling plugin 'com.huawei.agconnect', creating a special upload certificate, uploading an .aab, adding sha-256 hashes to Project configuration, adding push_kit_auto_init_enabled to the manifest, creating a subclass of HmsMessageService.

Upvotes: 4

Views: 3892

Answers (3)

zhangxaochen
zhangxaochen

Reputation: 33997

This error code means the service is not enabled in AppGallery Connect.

Please check whether you have enabled the Push Service.

  1. Sign in to AppGallery Connect and select My projects.
  2. Find your project from the project list and click the app for which you need to enable a service on the project card.
  3. Click the Manage APIs tab and toggle the switch for the service to be enabled.

For more information, see docs.

Upvotes: 0

SanghatiM
SanghatiM

Reputation: 193

Check whether HMS push kit is enabled properly like below image:

enter image description here

Upvotes: 8

RiteshChanchal
RiteshChanchal

Reputation: 81

Login to app gallery connect, go to My Projects. Select your project. Select Manage API , and enable push kit. For details, please refer to Enabling Services.

Upvotes: 0

Related Questions