npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

health-data

v0.0.3

Published

Capacitor Plugin to Retrieve User's Device Step Count on Android

Downloads

7

Readme

health-data

Capacitor Plugin to Retrieve User's Device Step Count on Android

Install

npm install health-data
npx cap sync

API

Plugin for accessing health data and step counters.

echo(...)

echo(options: { value: string; }) => Promise<{ value: string; }>

Echoes back the provided value.

| Param | Type | Description | | ------------- | ------------------------------- | --------------------- | | options | { value: string; } | - The options object. |

Returns: Promise<{ value: string; }>


getSteps()

getSteps() => Promise<{ name: string; count: number; }>

Retrieves the step count value from the step counter sensor since it was started. Returns null if the necessary permissions have not been granted. Once the permissions are granted, subsequent calls will return the correct step count value. If the device doesn't have a step counter sensor, it won't return anything, but a message indicating that the sensor is not available will be logged to the console.

Returns: Promise<{ name: string; count: number; }>


checkPermission(...)

checkPermission(options?: CheckPermissionOptions | undefined) => Promise<CheckPermissionResult>

Checks the status of the permission and requests it for the first time if it hasn't been granted. The permission status remains unchanged once it has been granted for the rest of the application usage.

| Param | Type | Description | | ------------- | ------------------------------------------------------------------------- | --------------------- | | options | CheckPermissionOptions | - The options object. |

Returns: Promise<CheckPermissionResult>


openAppSettings()

openAppSettings() => Promise<void>

Opens the app settings screen for the current app.


Interfaces

CheckPermissionResult

| Prop | Type | Description | Since | | ---------------- | -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- | | granted | boolean | When set to true, the permission is granted. | | | denied | boolean | When set to true, the permission is denied and cannot be prompted for. The openAppSettings method should be used to let the user grant the permission. | 0.0.1 | | asked | boolean | When this is set to true, the user was just prompted the permission. Ergo: a dialog, asking the user to grant the permission, was shown. | 0.0.1 | | neverAsked | boolean | When this is set to true, the user has never been prompted the permission. | 0.0.1 | | restricted | boolean | iOS only When this is set to true, the permission cannot be requested for some reason. | 0.0.1 | | unknown | boolean | iOS only When this is set to true, the permission status cannot be retrieved. | 0.0.1 |

CheckPermissionOptions

| Prop | Type | Description | Default | Since | | ----------- | -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | ----- | | force | boolean | If this is set to true, the user will be prompted for the permission. The prompt will only show if the permission was not yet granted and also not denied completely yet. | false | 0.0.1 |