4. CoreData for other non-health stats You made it to the end! Ok, so we are basically going to be adding another store to our app and reading and writing data to THAT store as well. First let’s add a new tab and make it a UITableViewController as well. It will have dynamically populated cells. Now […]
Tag Archives: HealthKit
As people who know me might know I have been playing around with various wearables for some years now, starting with a Nike Fuel Band, and also trying out products from Misfit and UP along the way. I have mostly just watched with interest as my exercise levels, and indeed sleep now we have a little one in the house, has gone up and down over time.
I am going to assume the rest of the Cordova App is in place and start with a simple wearable object which exposes a promise that allows you to check whether HealthKit is available on this platform, you might have iOS 8 but HealthKit is iPhone only. Remember that most of Cordova is interacting with a bunch of asynchronous native systems so you have to make sure you consider this as you work with it. Hence the liberal use of promises. (If you are wanting to support < iOS 8 then you will need to use a different promise library / shim) In this case I am also using the underscorejs library to create a promise who’s result won’t be calculated until it is invoked for the first time.