Ionic 7 + Cordova step counter / pedometer (Ionic Health?)

Hi Guys,
I want to implement a pedometer (step counter) in an Ionic 7 + Cordova project.
I found these plugins:

  • cordova-plugin-pedometer

  • cordova-plugin-stepcounter

Are they still working?
Is anyone using them in production?
Is there a stable and up-to-date solution for both Android and iOS?

Also, is using Ionic Health / HealthKit / Google Fit integration a better approach for step counting in Ionic?

Any guidance is appreciated. Thanks.

Just for clarification, this forum is for Ionic and Capacitor and I think there are very few people using Cordova still here.

Those are 3rd party plugins so your best bet would be to look at the repos.

If you switch to Capacitor, there is this plugin Pedometer Plugin for Capacitor - Capawesome

If you search here for “Google fit” there are some other posts about it.

1 Like

Migrating a plugin-heavy Cordova project to Capacitor would be extremely exhausting and risky for me. It’s basically a rebuild, not just a migration. If there’s no stable alternative, I’m leaning toward not using pedometer / health / healthkit features at all.

I’m already getting errors like:

[StepCounter] Error stack: Error: Health plugin is not installed or not available on this platform

If there’s no well-maintained, production-ready Cordova solution, then this turns into a migration + plugin rewrite effort, which isn’t sustainable for me right now. Dropping the feature seems like the most realistic option.

I’m using an Ionic 7 + Cordova project with cordova-plugin-health.

What I found:

  • cordova-plugin-pedometer → outdated, not usable

  • cordova-plugin-stepcounter → Android-only, not reliable

What worked (partially):

I used Health plugin (Google Fit / HealthKit).

Needed Android config:

<uses-permission android:name="android.permission.ACTIVITY_RECOGNITION" />
<uses-permission android:name="android.permission.health.READ_STEPS" />
<uses-permission android:name="android.permission.health.WRITE_STEPS" />

Also:

<queries>
    <package android:name="com.google.android.apps.healthdata" />
</queries>

Issues:

  • Works only on real device

  • Depends on Health Connect / HealthKit

  • Some devices return no step data

  • Got errors like:

Health plugin is not installed or not available

Conclusion:

:backhand_index_pointing_right: No stable Cordova pedometer solution
:backhand_index_pointing_right: Health plugin is the only option but not fully reliable