A plugin that abstracts fitness and health repositories like Apple HealthKit or Google Fit.

Ionic Health插件的安装(Installation)

ionic cordova plugin add cordova-plugin-health npm install @ionic-native/health

Ionic Health插件支持的平台(Supported Platforms)

  • Android
  • iOS

Ionic Health插件的用法(Usage)

import { Health } from '@ionic-native/health';

constructor(private health: Health) { }

.then((available:boolean) => {
    '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 for a full list of Datatypes and see examples.