'Apple Health Kit Data via Rest API

Are there any third party which provide data of apple health kit data using there end points like google fit provide us via rest api's https://developers.google.com/fit/rest/v1/get-started



Solution 1:[1]

No, there are not.

And there most likely won't be in the future either. This is an easy conclusion to make given how Health Kit integration works today and how Apple has privacy protocols around Health Data -

Integrating Health Kit in your app allows you to see Health Data only after the user has granted relevant permissions (of course). But the user has to explicitly grant permission for each datatype (HKObjectType) eg sleepAnalysis, blood glucose etc.

Your app with Health Kit integration can only request Health Data while the app is active in the background and the phone is not locked or running in the foreground. So lets say you have background tasks (BGAppRefreshTask or BGProcessingTask) to request Health Data - this won't work if your phone is locked.

Given these behaviours and other restrictions Apple places around the use of HealthKit, I don't see how there is ever (or at least in the near future) going to be a an api to relay this data.

If you absolutely had to it, your best bet would be to write an application on the device that integrates with HealthKit and exports HealthData to your servers. Then explicitly prompt the user to export HealthData from the app every time, and expose an api from your server. Not happening.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 rasulfahad