GithubHelp home page GithubHelp logo

taylorlamar / healthkit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from eddyverbruggen/healthkit

0.0 0.0 0.0 266 KB

Cordova plugin for the iOS HealthKit framework

License: MIT License

Objective-C 96.08% JavaScript 3.92%

healthkit's Introduction

Cordova HealthKit Plugin

NPM version Downloads Twitter Follow

Supported functions

See the example for how to use these functions.

  • available: check if HealthKit is supported (iOS8+, not on iPad)
  • checkAuthStatus: pass in a type and get back on of undetermined | denied | authorized
  • requestAuthorization: ask some or all permissions up front
  • readDateOfBirth: formatted as yyyy-MM-dd
  • readGender: output = male|female|other|unknown
  • readBloodType: output = A+|A-|B+|B-|AB+|AB-|O+|O-|unknown
  • readFitzpatrickSkinType: output = I|II|III|IV|V|VI|unknown
  • readWeight: pass in unit (g=gram, kg=kilogram, oz=ounce, lb=pound, st=stone)
  • saveWeight: pass in unit (g=gram, kg=kilogram, oz=ounce, lb=pound, st=stone) and amount
  • readHeight: pass in unit (mm=millimeter, cm=centimeter, m=meter, in=inch, ft=foot)
  • saveHeight: pass in unit (mm=millimeter, cm=centimeter, m=meter, in=inch, ft=foot) and amount
  • saveWorkout
  • findWorkouts: no params yet, so this will return all workouts ever of any type
  • querySampleType
  • querySampleTypeAggregated
  • sumQuantityType
  • monitorSampleType
  • saveQuantitySample
  • saveCorrelation
  • queryCorrelationType
  • deleteSamples

Resources

Tips

Installation

Using the Cordova CLI?

cordova plugin add com.telerik.plugins.healthkit --variable HEALTH_READ_PERMISSION='App needs read access' --variable HEALTH_WRITE_PERMISSION='App needs write access'

HEALTH_READ_PERMISSION and HEALTH_WRITE_PERMISSION are shown when your app asks for access to data in HealthKit.

Using PhoneGap Build?

<plugin name="com.telerik.plugins.healthkit" source="npm" />

<!-- Read access -->
<config-file platform="ios" parent="NSHealthShareUsageDescription">
  <string>App needs read access</string>
</config-file>
<!-- Write access -->
<config-file platform="ios" parent="NSHealthUpdateUsageDescription">
  <string>App needs write access</string>
</config-file>

Using PhoneGap Build - cli-7 or superior?

PhoneGap Build has recently migrated from the custom build process to the standard Cordova build process. If you are already running on the new builder, it is no longer necessary to add the variables differently, and the variables must be defined as in the Cordova case.

<platform name="ios">
    <plugin name="com.telerik.plugins.healthkit" spec="^0.5.5" >
        <variable name="HEALTH_READ_PERMISSION" value="App needs read access" />
        <variable name="HEALTH_WRITE_PERMISSION" value="App needs write access" />
    </plugin>        
</platform>

Need Clinical Records Functionality (FHIR)?

If you would like to read clinical record (FHIR) data from the HealthKit store you can use the fork of this plugin here. Please see EddyVerbruggen#113 for why this was functionality was removed from this plugin.

healthkit's People

Contributors

eddyverbruggen avatar rossmartin avatar emmavray avatar lamuertepeluda avatar schigh avatar hdavidzhu avatar kingsfleet avatar igoris avatar northmccormick avatar awatson1978 avatar anibalsanchez avatar drbeermann avatar paulmillr avatar sgilroy avatar seanbdoherty avatar

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.