Skip to main content
Version: v5

Stepcounter

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

Use to

  • start and stop stepcounter service
  • read device's stepcounter data

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

Stuck on a Cordova issue?

Don't waste precious time on plugin issues.

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

$ npm install cordova-plugin-stepcounter 
$ npm install @awesome-cordova-plugins/stepcounter
$ ionic cap sync

Supported Platforms

  • Android

Usage

React

Learn more about using Ionic Native components in React

Angular

import { Stepcounter } from '@awesome-cordova-plugins/stepcounter/ngx';

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));