Git Product home page Git Product logo

healthpulse's Introduction

#HealthPulse

HealthPulse is a small iOS app, built with React Native, that pushes data from HealthKit to a desired endpoint.

##Why?

I felt that Apple lacked of a web API for HealthKit and I wanted to use my HealthKit data that was "trapped" in my iPhone, so I built my own API (which uses GraphQL) with my own health dashboard (see https://health.maximeheckel.com and https://github.com/MaximeHeckel/health-dashboard). This app basically allowed me to have a "bridge" between HealthKit and my API, and I thought that maybe other people would find it useful.

I've improved it and used it for several months now and it helped me gathered a significant amount of data from my Apple Watch.

##Installation

  1. Run it on your iOS device.
  • Clone the project (I might end up doing proper releases on Github)
  • Run react-native bundle
  • Open /ios/healthPulse.xcodeproj
  • In appDelegate.m copy and paste/replace the following lines to update the jsCodeLocation variable:
//jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];
  jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
  • Build and run the app (you might need a Apple Developer account to run it on a physical iOS device)
  1. Contribute to the project
  • Clone the project
  • Inside the project folder, run npm install to install react-native and all the dependencies required for the project to run
  • Run npm start

##Usage

I tried to make this app as simple as possible, in order to use it you just need to put your API endpoint on the first field, credentials for basic auth (if your server requires it) on the two following field and press and press the Push data button. If you let the app running on the background it will push your data against the endpoint you've set automatically (I used iOS Background Fetch for this, learn more here). If you're looking for a server example: https://github.com/MaximeHeckel/health-dashboard/tree/master/go/src/server.

####Payload

The folowing JSON object is a sample payload that the app sends:

{
	"date":"20170224",
	"heartRate":
		[{
			"value":72, 
			"startDate":"2017-02-24T18:58:26.947-0800",
			"endDate":"2017-02-24T18:58:26.947-0800"
		},
		...
		],
	"stepCountSamples":
		[{
			"value":34, 
			"startDate":"2017-02-24T18:58:26.947-0800",
			"endDate":"2017-02-24T18:58:26.947-0800"
		},
		...
		],
	"sleepAnalysus":
		[{
			"value":"INBED", 
			"startDate":"2017-02-24T18:58:26.947-0800",
			"endDate":"2017-02-24T18:58:26.947-0800"
		},
		...
		],
	"stepCount": {
		"value": 1000,
		"startDate":"2017-02-24T18:58:26.947-0800",
		"endDate":"2017-02-24T18:58:26.947-0800"
	},
	"cyclineDistance": {
		"value": 1000,
		"startDate":"2017-02-24T18:58:26.947-0800",
		"endDate":"2017-02-24T18:58:26.947-0800"
	},
	"walkinRunningDistance": {
		"value": 1000,
		"startDate":"2017-02-24T18:58:26.947-0800",
		"endDate":"2017-02-24T18:58:26.947-0800"
	},
	"weight": {
		"value": 7000,
		"startDate":"2017-02-24T18:58:26.947-0800",
		"endDate":"2017-02-24T18:58:26.947-0800"
	},
	"bodyfatpercentage": {
		"value": 12,
		"startDate":"2017-02-24T18:58:26.947-0800",
		"endDate":"2017-02-24T18:58:26.947-0800"
	},
	"bmi": {
		"value": 22,
		"startDate":"2017-02-24T18:58:26.947-0800",
		"endDate":"2017-02-24T18:58:26.947-0800"
	}
}

##Limitations

It doesn't look like it's possible to have access to the data from HealthKit, when the phone is locked, thus the background push will only work while you're using the phone.

healthpulse's People

Contributors

maximeheckel avatar

Watchers

James Cloos avatar Alex M. Podobas 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.