I have an arduino which generates a simulated heart rate.I am able to connect to the iPhone using BLE and save the heart rate into the health vault.
For test purpose I want to send low heart rate notification to the iPhone health vault whenever the heart rate falls below a certain level. However, the apple documents mentions that i cannot write to the low heart rate notification. If so, how is iwatch able to write to the iPhone health vault for low heart rates?
Extract from apple document
The low heart rate samples are read-only. Use this identifier to request permission to read these samples; however, you can’t request authorization to share them, and you can’t save new low heart rate events to the HealthKit store.
Please recommend some steps to achieve the above?
Often time Apple made applications can get some special privileges using undocumented API or Info.plist keys. Apple is allowing itself to use those undocumented/restricted features for its own products (obviously) but due to either risk of abuse, or because the API is not yet in a clean-enough state for them, they do not want developers to use those features.
So it is quite possible that in this case there is no proper way for you to achieve this exact behaviour.
As #Scriptable mentioned, maybe just sending low values would be enough for their library to decide if a notification should be sent.
Related
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.
My work wants to test their new modems using an iPhone app. We can use a current app or build a brand new one. Third party apps are OK but want to avoid jailbreaking if possible.
We want an app which connects to the network and monitors certain parameters for a set amount of time. We will log attributes from the network and modem. We already know it's possible to test speed, disconnections, reconnection time etc. Some of the parameters we need to track might be more secure or outside Apple's regulations.
These are the responses we are looking for:
Frequency (ie. 2462MHz)
Channel Bandwidth (ie. 20MHz, 40MHz)
Radio Type (ie. 802.11a,b,g,n,ac)
802.11 Deauth Reason code
802.11 Association Status code
How can we track the above attributes using an iOS app?
Are there any apps out there that can track this information? Does iOS have anything for tracking these parameters?
Thanks so much!!
Apple recently made heart hate raw data avaliable through healthkit, but the documentation is very confusing and I can not understand exactly how to measure the heartbeat of someone wearing the watch. I could not find any good examples on the internet either, so I'm hoping that someone could help me understand how can I get these values in a easy way.
The key is to check out HealthKit, not WatchKit. From the docs:
Setting Up HealthKit
Before you can begin using HealthKit, you must perform the following steps:
Enable the HealthKit capabilities in Xcode.
Check to see whether HealthKit is available by calling the isHealthDataAvailable method. HealthKit is not available on iPad. Additionally, HealthKit can be disabled on other devices—for example, iPhones that are provisioned for schools or corporate environments.
Instantiate an HKHealthStore object for your app. You need only one HealthKit store per app. This store acts as your primary interface with the HealthKit database.
Request authorization to access HealthKit data using the requestAuthorizationToShareTypes:readTypes:completion: method. HealthKit requires fine-grained authorization. You must request permission to share and read each type of data.
Etc....
I'm writing an iOS app to display real-time Heart Rate from a BTLE device (the Polar H7). I've found 2 ways to do this:
Using CBCentralManager and bit-twiddling the Heart Rate Measurement Characteristic by hand
Using HealthKit's HKObserverQuery
As I see it, there are pros/cons to each approach.
Using CBCentralManager enables more control (e.g., you can store the sensor location) and quicker setup (i.e., you can start displaying values immediately). But, from what I can tell, the BTLE device will not be seen by CBCentralManager if the BTLE device is already paired with HealthKit.
Using HealthKit appears to be the preferred approach (and is much simpler to implement) but requires an extra trip to the Health app to turn on the "Update Health Data" switch.
Should I implement both? Has anyone dealt with this issue?
I haven't dealt with your issue specifically, but I am working on HealthKit integration as well. Based on what you've outline here, I would go with the HealthKit approach and only that approach unless there's some requirement to really push you do to both. If you do have to implement both, I would probably put some abstraction in there so the controllers don't have to know what the source is.
I'm not sure about the extra trip to the Health app you mention. You can ask for permission to the heart rate data from within your app using requestAuthorizationToShareTypes:readTypes:completion:. Here's a tutorial that has a walk through, in case that helps at all: HealthKit Tutorial with Swift: Getting Started.
for Android, several apps exist that show such information, like https://play.google.com/store/apps/details?id=com.farproc.wifi.analyzer does it:
I need similar functionality in my iOS app but can't find any information about that. It this forbidden by Apple?
Apple doesn't allow apps to access the hardware like that. A fairly common workaround is to measure network throughput instead. You could take periodic samples of the current network speed, and then display that data over time.
Network Multimeter, for example, is an app that will give you info on your network as you walk around. It does that by sending data across the network and displaying the throughput.