Health
A plugin that abstracts fitness and health repositories like Apple HealthKit or Google Fit.
https://github.com/dariosalvi78/cordova-plugin-health
Stuck on a Cordova issue?
If you're building a serious project, you can't afford to spend hours troubleshooting. Ionicβs experts offer premium advisory services for both community plugins and premier plugins.
Installation
- Capacitor
- Cordova
- Enterprise
$ npm install cordova-plugin-health
$ npm install @awesome-cordova-plugins/health
$ ionic cap sync
$ ionic cordova plugin add cordova-plugin-health
$ npm install @awesome-cordova-plugins/health
Ionic Enterprise comes with fully supported and maintained plugins from the Ionic Team. Β Learn More or if you're interested in an enterprise version of this plugin Contact Us
Supported Platforms
- Android
- iOS
Usage
React
Learn more about using Ionic Native components in React
Angular
import { Health } from '@awesome-cordova-plugins/health/ngx';
constructor(private health: Health) { }
...
this.health.isAvailable()
.then((available:boolean) => {
console.log(available);
this.health.requestAuthorization([
'distance', 'nutrition', //read and write permissions
{
read: ['steps'], //read only permission
write: ['height', 'weight'] //write only permission
}
])
.then(res => console.log(res))
.catch(e => console.log(e));
})
.catch(e => console.log(e));
See description at https://github.com/dariosalvi78/cordova-plugin-health for a full list of Datatypes and see examples.