Third-Party Application Connect to Huawei Health

Min Uswachoke
3 min readNov 23, 2020

Previously if you have tried to develop an application to connect to Huawei Health, the data is always empty. That is because Huawei Health kit does not support third-party application to retrieve user health data. But as of currently in Mid-November of 2020, the latest patch have arrived and third-party application can now retrieve the data both by the use of SDK or by Restful Api.

This guide will help you to solve a common issue with Health Kit, as well as how to support NON-HMS phone. There is multiple useful guide for developing Huawei Health whether it is restful API, or conventional SDK integration.

After you finish integration with Huawei Health kit and still there is no health data feeding to your application, you should be checking for:

  1. Data Sharing is enable? Make sure the Health kit is Linked. If there is no Health Kit in the list, that is because the phone is GMS and Huawei Health still do not support, skip to section on how to connect with GMS
Can be found in data sharing page in Huawei health

2. User Privacy is being accepted? Make sure in Privacy Setting, all of these is turned on.

3. Checking from restful API? Trying calling for privacyRecords, the token is the Oauth token from user login. Make sure the opinion is 1. If the opinion is two, user privacy setting is still disable.

Supporting NON-HMS phone

As of current version of Huawei Health, GMS or IOS phone can not link Huawei Health app to Huawei Health cloud. Meaning all data will be kept inside the Huawei Health application only, third party application always receive an empty data. This issue however would be fixed in the upcoming patch which will be deliver by the end of January 2021. In the meanwhile you may follow my guideline.

GMS phone can not send to Huawei Cloud

THE SOLUTION

Link GMS phone to Google fit, inside Huawei Health’s Data Sharing there is an option to link to google fit. Then inside the third-party application integrate Google Fit SDK to retrieve the data.

However in this solution, for IOS application will also need to linked to Apple Health, and the application also integrate IOS Health kit.

Conclusion

If you having trouble retrieving data from Huawei Health please follow the guideline in first section. However if the phone is GMS and in the data sharing is showing only linking to google fit, link the Huawei Health to Google fit, and retrieve the data from Google Fit Api instead. However in the next version of Huawei Health, it will support to link GMS phone to Huawei Health cloud, also IOS phone in the following version as well.

--

--