1

I'm developing an application using Huawei push service and it was working fine until the last couple of days the

String appId = AGConnectServicesConfig.fromContext(this).getString("client/app_id");
String hmsToken = HmsInstanceId.getInstance(this).getToken(appId, DEFAULT_TOKEN_SCOPE);

started throwing not authorized exception i triple checked my setting in app gallery connect and all seem fine

enter image description here

zhangxaochen
  • 32,744
  • 15
  • 77
  • 108
  • hi@Nickola Jarjous, could you pls share the complete log obtained when the issues occurred ? Also to solve this issue, can we otained two screenshot of the page for enabling the push rights in the AGC background? like following [pics1](https://i.stack.imgur.com/gUvsA.png) and [pics2](https://i.stack.imgur.com/WFVCQ.png) – zhangxaochen Sep 03 '21 at 01:47
  • In addition, try uninstalling hmscore apk and reinstalling it to see if the problem persists. – zhangxaochen Sep 03 '21 at 01:51

1 Answers1

1

Someone gave me this answer on the Huawei developer forums and it worked. Just add the HMS toolkit plugin to Android studio and run the configuration wizard. It checks all your added Huawei services, along with agcconnect.json file, and it rebuilds your project.

ouflak
  • 2,458
  • 10
  • 44
  • 49