1

In HMS Push Kit, getToken() method is not working on Android version 9 (not getting token). but in Android 10 version, token is getting with same method.

Tested in two devices:

  1. Honor 9X Pro HLK-L42 Android version 9 EMUI 9.1.1

  2. Honor 9S Model: DUA-LX9 Android version 10 Magic UI 3.1.0

KirubaPradeep
  • 287
  • 1
  • 7

2 Answers2

0

Check Whether you are using HmsMessageService.onNewToken for get new token for device less than EMUI 9.1.

If not then for EMUI version is earlier than 10.0, call onNewToken method to return a token. https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/android-client-dev-0000001050042041

KirubaPradeep
  • 287
  • 1
  • 7
0

As described here in this FAQ: https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/faq-0000001050042183

What can I do if the onNewToken method cannot be called back when the EMUI version is earlier than 10.0? If the EMUI version on a Huawei device is earlier than 10.0 and no token is returned using the getToken method, a token will be returned through the onNewToken method. If the onNewToken method cannot be called back, check whether Push Kit is enabled.

Please try out onNewToken as described in this.

Zinna
  • 1,947
  • 2
  • 5
  • 20