Coder Social home page Coder Social logo

Excited about healthkit HOT 5 CLOSED

eddyverbruggen avatar eddyverbruggen commented on July 19, 2024
Excited

from healthkit.

Comments (5)

cacardinal avatar cacardinal commented on July 19, 2024

I second your excitement. Looking forward to a response.

from healthkit.

EddyVerbruggen avatar EddyVerbruggen commented on July 19, 2024

Hi guys, thanks for the comments 👍

I've just checked in some basic plumbing and a test method for storing and reading one of the parameters of the HealthKit SDK (weight). I was able to store the weight via Javascript and see the update in the Health app of iOS8. Pretty cool stuff.

Before turning this into something more useful for developers, I'd like to ask you: which features do you expect the plugin to have. Which usecases do you have in mind exactly?

Thanks for thinking with me on this,
Eddy

from healthkit.

gylippus avatar gylippus commented on July 19, 2024

@EddyVerbruggen awesome. Would love to be able to post a completed activity with activity length and calories burned if that is an option. Was going to dive into the docs a bit more this week myself but I think these are options.

from healthkit.

EddyVerbruggen avatar EddyVerbruggen commented on July 19, 2024

Hi, I've added a few methods to play with.
@gylippus I will be looking at the Workout feature real soon. Here's the Workout reference btw.

from healthkit.

gylippus avatar gylippus commented on July 19, 2024

@EddyVerbruggen awesome. Well done. Was looking through the docs yesterday and imagined a common scenario would be something like this: https://developer.apple.com/library/ios/documentation/HealthKit/Reference/HKWorkout_Class/

workoutWithActivityType:startDate:endDate:duration:totalEnergyBurned:totalDistance:metadata:
+ (instancetype)workoutWithActivityType:(HKWorkoutActivityType)workoutActivityType
                              startDate:(NSDate *)startDate
                                endDate:(NSDate *)endDate
                               duration:(NSTimeInterval)duration
                      totalEnergyBurned:(HKQuantity *)totalEnergyBurned
                          totalDistance:(HKQuantity *)totalDistance
                               metadata:(NSDictionary *)metadata
window.plugins.healthkit.saveWorkout({
          'activityType': 'HKWorkoutActivityTypeCrossTraining'", // Directly associated with an HKWorkoutActivityType constants, maybe later custom activity
          'startDate': "", // Optional Date() of start
          'endDate': "", // Optional Date() of end
          'duration': "1200", // Duration in seconds or milliseconds
          'energyBurned': "120", // Total Energy burned, calories or kCal? 
          'totalDistance': "", // Optional distance? Maybe meters?
          'extraData': "", // Not sure how necessary this is
        },
        callback,
        callback
    );

If you think of any ways I can help, definitely let me know. Even if just testing.

from healthkit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.