HMS-Core / hms-flutter-plugin

This repo contains all of Flutter HMS plugins.
https://developer.huawei.com/consumer/en/doc/overview/HMS-Core-Plugin?ha_source=hms1
Apache License 2.0
282 stars 139 forks source link

Error when get token for hms #295

Closed mohammedhasna2015 closed 1 year ago

mohammedhasna2015 commented 1 year ago

Description i try to get token usign function Push.getToken('') but its return error

Expected behavior return token

Current behavior return null

Screenshots

image

Logs Post logs here or paste them to Ghostbin and insert the link here.

Environment

Other Add any other context about the problem here

peura-toni commented 1 year ago

The resultCode 907135003 indicates that there is an issue with the HMS core installation or the version being used is outdated. The steps to resolve this issue vary depending on whether the device is a Huawei or non-Huawei device.

For non-Huawei devices:

  1. Install the updated version of HMS core on your device.
  2. To do this, you can download the latest version from this link.

For Huawei devices:

  1. Open the application market on your Huawei device.
  2. Search for HMS Core and update it to the latest version.

If the above steps did not work, you can try fixing the HMS core cache issue by following these steps:

  1. Check if your mobile phone network can access the internet properly.
  2. If there are any connection issues, reconnect to the network.
  3. Clear the HMS core cache by going to Settings > Applications > Application settings, and search for HMS Core. Then, clean the cache or update it to the latest version and try again.
  4. If the problem persists, uninstall the application causing the issue, reinstall it, and try again.

Also, in the demo application (6.7.0.300 version), I managed to get the token successfully. I recommend you to try the demo in the GitHub repository.