If I understand it correctly, HealthKit can automatically connect with bluetooth accessories of the following types - heart rate monitor, glucose sensor, blood pressure monitor, health thermometer.
There is no need to have companion apps for them as they can write the data directly (and of course wirelessly) to HealthKit.
I am just curious if it is true and if so do all these accessories work seamlessly with HealthKit. Is no configuration needed. Has anyone tried it.
Further there are some accessories (such as the iHealth blood pressure monitor) which do the measurement only once the measurement is initiated from the companion app. So how do those tie-in.
As of iOS 8, the system can import data from a BTLE heart rate monitor directly into HealthKit with no companion app. This can be configured in the Bluetooth settings pane of iOS.
There is a WWDC video that goes into more detail about this available here. Also, if you have an idea for a HealthKit accessory that is not supported currently, you should contact Apple with this form.
Despite what was said during WWDC 2014, it appears only Heart Rate is available.
From HKSource Class Reference:
Source objects represents the different data sources in HealthKit. These sources may include apps and devices whose data can be directly imported into the HealthKit store. Currently, HealthKit supports only the direct import of heart rate data from Bluetooth LE devices. All other devices need a companion app to collect and save the data to HealthKit.
Related
I have multiple accelerometer sensors and I need to update the advertisementData name (CBAdvertisementDataLocalNameKey) of the each sensors for the first time of starting to use that sensors. What is the best way to update that from iOS (Objective-C or Swift) app?
You cannot control this data from your app as this data arrives directly "as is" from the remote BLE device. In this case, this is the name of the device that you are scanning for. Have a look at this:-
CBAdvertisementDataLocalName Apple Developer page
The Ultimate Guide to Apple's Core Bluetooth
The only way you can actually change this is if you have access to the accelerometer sensors' source code, and then changing the name will be dependent on the specific software running on these sensors.
Last year I built an iOS application that reads in workouts from Healthkit. These workouts were recorded by the Apple Watch in built fitness application and gathers heart rate information using photoplethysmography (the light sensor in the watch before the ECG).
I want to get the new Apply Watch with the ECG monitor. If I record a workout in the same manner as above, will the data from the ECG still be passed into Healthkit and will my mobile application therefore be able to read the workout from Healthkit and all the relative heartrate data?
I'm hoping I don't need to perform any updates on my mobile application now that the apple watch has an ECG and not the photoplethysmography.
Does the new Apple Watch come with both photoplethysmography and the ECG or just the ECG?
As of iOS 14 and watchOS 7, you can now read an ECG sample as an HKElectrocardiogram.
https://developer.apple.com/videos/play/wwdc2020/10182/?t=105
Is it possible to read/sync the Heart Rate data from Apple watch series 3 without creating a watch app?
I want my iPhone app to read data directly from the Apple Watch without having to create an app for the watch too.
Apple Watch syncs all of its recorded heart rate data (automatically sampled every five minutes while wearing, and more frequently during workout sessions) to the HealthKit store on the companion iPhone.
So you can create an iOS app that (with the user's permission) reads the stored heart rate data using HealthKit. The gist of it:
Set up your project for HealthKit support in Xcode's Capabilities pane (part of your app target settings).
Check for HealthKit availability on the device (HKHealthStore.isHealthDataAvailable()) and create an HKHealthStore object.
Verify that you have user permission to access heart rate data:
let heartRateType = HKObjectType.quantityType(forIdentifier: .heartRate)!
healthStore.requestAuthorization(toShare: nil, read: [heartRateType], completion: myHandler)
After that completion handler reports success, use HKSampleQuery to search for the most recent heart rate sample, a set of heart rate samples within a specified time frame, etc. (Or other HKQuery subclasses for things like average heart rate over time, etc.)
If instead what you're asking is for a way to read the user's current heart rate "right now" from an iOS app, without creating a companion watchOS app... no, there's not a way to do that.
This question already has answers here:
How to get sensor data from Apple Watch to iPhone?
(2 answers)
Closed 7 years ago.
I'm reading several articles and Apple's documents regarding Apple Watch and WatchKit development. It looks like third-party apps for Apple Watch like Strava and Runtastic will need you to also carry your iPhone while doing exercise to take and show data (as described in App Store Apps), but I don't find if the built-in apps (Activity and Workout) will also need it. It looks a bit uncomfortable having to carry your iPhone while running to be able to see your heart rate, speed and so on in the watch...
Regarding the data measured by the heart rate sensor and accelerometer integrated in the Apple Watch: is there an API that makes them accessible to third-parties developers?
And how is data mesaured by those sensors handled by the watch: is it directly sent to the paired iPhone as it is measured? It is temporarily and locally persisted in the watch until it is possible to send it to the iPhone? Is HealthKit available for WatchKit apps to handle such information?
Thanks in advance
Watchkit Sensor raw data information is now accessible with WatchKit for watchOS 2.0.
WatchOS 2 includes many enhancements to other existing frameworks such as HealthKit, enabling access to the health sensors that access heart rate and health information in real-time.
You could check this information in the following session which is total 30 minutes presentation. If you do not want to watch entire session, then you directly jump to Healthkit API features which is in between 25-28 min:
WatchKit watchOS 2.0 Session in WWDC 2015
I played with the Apple Watch at the Apple Watch lab.
The sensors and accelerometer are not accessible to devs.
You can go running without your phone and when you get home the heart rate data will 'eventually' be sent to Health on your phone, from which you can query data for your app. Any heart rate or sensor data saved on the Apple Watch cache is not accessible to dev.
I'm trying to get a better understanding of Bluetooth LE and been playing around with both iOS and Android's bluetooth stacks and various beacons (StickNFind, Estimote etc...)
On Android, when a device is discovered I get a raw "scan record" - a blob of data that I can parse myself to get the device's advertised data.
On iOS, this is parsed by iOS and presented as a dictionary.
Fair enough, except I was trying to use CoreBluetooth (ie: not location services) to read the advertisement data from an iBeacon and noticed that iOS seems to strip out the manufacturer specific advertisement data for iBeacon devices.
I realise I should probably be using Apple sanctioned ways for detecting iBeacons but it doesn't really fit our use case and wondering if there's a way around it.
EDIT: iOS does let you access the raw data for any Bluetooth advertisement that does not match the iBeacon format.
Unfortunately, iOS blocks access to the raw data of all BLE advertisements, including those of iBeacons. This makes it impossible to access the iBeacon identifiers with CoreBluetooth.
See details in this blog post.