Ad

Unable To Get Token Using Huawei_push

I have followed the steps in documentation to configure the huawei_push package in plugin. I want to integrate push notification. I am getting error when i use this code

void _onTokenEvent(String event) {
    token = event;
    if (token != null) {
      print("TokenEvent: " + token!);
    }
  }

  void _onTokenError(PlatformException error) {
    print("TokenErrorEvent: " + error.toString());
  }

  static Future<void> getToken() async {
    try {
      Push.enableLogger();

      await Push.getToken("");

      print('Huawei push token ::  ${HosNotificationHelper.token} ');

      Push.disableLogger();
    } catch (e) {
      print(e.toString());
      print('THISIS EXCEPTION');
    }
  }

and error is below

I/HMSSDK_c(31657): The local secret is already in separate file mode.
E/HMSSDK_HMSPackageManager(31657): Failed to find HMS apk
I/HMSSDK_HMSBIInitializer(31657): Builder->biInitFlag :false
2
E/HMSSDK_HMSPackageManager(31657): Failed to find HMS apk
I/HMSSDK_HuaweiApi(31657): inner hms is empty,hms pkg name is com.huawei.hwid
I/HMSSDK_HuaweiApiManager(31657): sendRequest
I/HMSSDK_BaseHmsClient(31657): ====== HMSSDK version: 50300304 ======
I/HMSSDK_BaseHmsClient(31657): Enter connect, Connection Status: 1
I/HMSSDK_BaseHmsClient(31657): connect minVersion:30000000 packageName:com.huawei.hwid
I/HMSSDK_Util(31657): available exist: true
E/HMSSDK_HMSPackageManager(31657): Failed to find HMS apk
I/HMSSDK_AvailableAdapter(31657): HMS is not installed
I/HMSSDK_BaseHmsClient(31657): check available result: 1
I/HMSSDK_BaseHmsClient(31657): bindCoreService3.0 fail, start resolution now.

Please help

Ad

Answer

E/HMSSDK_HMSPackageManager(31657): Failed to find HMS apk I/HMSSDK_AvailableAdapter(31657): HMS is not installed

This error indicates that the HMS Core is not installed on this device. Therefore, you are advised to search for the HMS Core in the AppStore of the phone, install it, and try again.

Ad
source: stackoverflow.com
Ad