Stepcounter

Contents

Cordova plugin for using device's stepcounter on Android (API > 19)

https://github.com/ihadeed/cordova-plugin-stepcounter

Ionic Stepcounter插件的安装(Installation)

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

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

  • Android

Ionic Stepcounter插件的用法(Usage)

import { Stepcounter } from '@ionic-native/stepcounter';

constructor(private stepcounter: Stepcounter) { }

...

let startingOffset = 0;
this.stepcounter.start(startingOffset).then(onSuccess => console.log('stepcounter-start success', onSuccess), onFailure => console.log('stepcounter-start error', onFailure));

this.stepcounter.getHistory().then(historyObj => console.log('stepcounter-history success', historyObj), onFailure => console.log('stepcounter-history error', onFailure));