Can iOS HealthKit data be accessed from a website? - ios

If someone gives permission to access their HealthKit data, can my website be able to display their most recent HealthKit data—their steps count for example. In other words, does HealthKit report to the cloud that can be accessed with an API? Or does it need to be an app that accesses the HealthKit data locally?

There is no cloud API, you would have to create an app that reads the HelathKit data and reports it to your backend.

Related

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
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.

How can we store firebase events offline and sync this events when device comes online bypassing 72 hours firebase offline sync limit?

We are having an enterprise application which is used in regions where there is no internet for many days. I am using Firebase for analytics and I have enabled firebase persistent storage which helps to send the analytics events to firebase when the device comes online but the limitation is it only sends 72 hours data to Firebase analytics. So, I want firebase to get at least offline analytics data of the last 10 days. Can I achieve this by storing this analytics event in core data when the device is offline and send this event to firebase when the device is connected to the internet? Or is there any alternative way to achieve this? I only want to send the event name and timestamp of the event.

Get number of active users for an iOS

We are building a custom, company-wide dashboard. Is there a way to get the number of users (through REST API) that downloaded and are actively using our iOS App?
Our app has Fabric integration (seems Fabric will be a part of Firebase soon?), but maybe there are other, better alternatives?
I checked Fabric and Firebase's document, there is no REST API to get activity data from these service. You can get data from their dashboard, the format is csv.
I saw some python library claimed they can do this job, but not sure these library can work or not. You can search "Firebase or Fabric" on PyPi.

Fetch HealtKit data from 3rd party devices

Can my app fetch HealtKit data from third party devices? For example from Garmin? In HKSource documentation, it seems that user would have to use Garmin app to transfer HealtKit data from his/hers device to iOS device and only then my app could use that data:
devices need a companion app to collect and save the data to
HealthKit.
Or can I write app, that would handle fetching data from 3rd party devices?
tl;dr Can my app get HealthKit data from 3rd party devices
Third party developers can provide import functionality to health app via the normal Health Kit API on iOS.
Some apps scrape or use web API such as Sync Solver exist to get FitBit data from the cloud to the local health app on iOS. Some such as Health Importer are more general. (proper disclosure: I work on this app)
We have an app on the store that is designed specifically for importing arbitrary CSV data into HealthKit / Health.App.
i hope without API you can't do this.

HealthKit data duplicity concerns

I have an app which reads data from Strava, Runkeeper and couple of other health apps.
Now I am planning to integrate HealthKit in my app and read data from there as well.
My concern is data duplicity. i.e. say Strava sharing same data to my app and Healthkit, and then my app updating same data from HealthKit.
Not sure if this is allowed due to privacy concerns or not, Is there any way my app can know what all apps share data with HealthKit, preferably date range and type of data as well.
OR
Do I need to build the comparison logic in my app itself to detect duplicate data based on date and actual data?
The best way to do this with the HealthKit API is to simply not process data that comes from providers that your app can already integrate with. Every HKObject has an HKSource property, and that HKSource will give you the bundle identifier of the application that created it. You can use this to create a blacklist of sources to reject from HealthKit.
HealthKit framework is a centralized store for health data among various applications with in the iPhone device. So, all the health apps can share health data with HealthKit store.
For your case, there may be possibly 2 solutions available.
Simply stop updating health data from all other health apps like Strava, RunKeeper, etc., and read same information from Apple's HEALTH app to avoid duplicate records.
Read health data from all other health apps which you would prefer and omit the health data fetching from Apple's HEALTH app, which was entered from Strava, RunKeeper, etc., Sample to get the health data based on source is https://stackoverflow.com/a/29346592/1295573
Yes you can do this with health kit.
The HealthKit store provides a number of methods for accessing its data.
Direct method calls
Sample query
Observer query
Anchored object query
Statistics query
Statistics collection query
Correlation query
Source query
For more details go through https://developer.apple.com/library/ios/documentation/HealthKit/Reference/HealthKit_Framework/..
let me know if you get stuck somewhere.. :)

Resources