시작하기
설치 단계와 이 플러그인의 전체 마크다운 가이드가 포함된 설정 지시를 복사하세요.
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-pedometer`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/pedometer/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
Capgo의 AI-Assisted Setup을 사용하여 플러그인을 설치할 수 있습니다. AI 도구에 Capgo 스킬을 추가하려면 다음 명령어를 사용하세요.
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins그런 다음 다음 프롬프트를 사용하세요:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-pedometer` plugin in my project.Copy to clipboard
bun add @capgo/capacitor-pedometerbunx cap syncCopy to clipboard
Importimport { CapacitorPedometer } from '@capgo/capacitor-pedometer';API Overview
API 개요getMeasurement
__CAPGO_KEEP_0____CAPGO_KEEP_0__
import { CapacitorPedometer } from '@capgo/capacitor-pedometer';
await CapacitorPedometer.getMeasurement();isAvailable
__CAPGO_KEEP_0__이 장치에서 사용 가능한 페이스 메터 기능을 확인하세요.
import { CapacitorPedometer } from '@capgo/capacitor-pedometer';
await CapacitorPedometer.isAvailable();startMeasurementUpdates
__CAPGO_KEEP_0__실시간 페이스 메터 측정 업데이트를 받기 시작하세요.
__CAPGO_KEEP_1__ __CAPGO_KEEP_2__ __CAPGO_KEEP_3__ __CAPGO_KEEP_4____CAPGO_KEEP_5__ measurement __CAPGO_KEEP_6__ startMeasurementUpdates().
import { CapacitorPedometer } from '@capgo/capacitor-pedometer';
await CapacitorPedometer.startMeasurementUpdates();stopMeasurementUpdates
__CAPGO_KEEP_0__실시간 계단수 측정 업데이트 수신 중지.
import { CapacitorPedometer } from '@capgo/capacitor-pedometer';
await CapacitorPedometer.stopMeasurementUpdates();checkPermissions
__CAPGO_KEEP_0__자전거 데이터 접근 권한 확인.
켜기 안드로이드, 이 기능은 ACTIVITY_RECOGNITION 권한을 확인합니다.
iOS, 이 기능은 운동 사용 권한을 확인합니다.
import { CapacitorPedometer } from '@capgo/capacitor-pedometer';
await CapacitorPedometer.checkPermissions();requestPermissions
requestPermissions步수計 데이터에 대한 접근 허가를 요청합니다.
On Android, 이 요청은 ACTIVITY_RECOGNITION permission.
On iOS, 이 요청은 운동 사용 허가를 요청합니다.
import { CapacitorPedometer } from '@capgo/capacitor-pedometer';
await CapacitorPedometer.requestPermissions();Type Reference
타입 참조GetMeasurementOptions
GetMeasurementOptionsexport interface GetMeasurementOptions { /** * The start time for the measurement query (milliseconds since epoch). * * Required on **iOS**. * * @since 0.0.1 */ start?: number;
/** * The end time for the measurement query (milliseconds since epoch). * * Required on **iOS**. * * @since 0.0.1 */ end?: number;}Measurement
__CAPGO_KEEP_1__export interface Measurement { /** * The number of steps taken by the user. * * @since 0.0.1 */ numberOfSteps?: number;
/** * The estimated distance (in meters) traveled by the user. * * Only available on **iOS**. * * @since 0.0.1 */ distance?: number;
/** * The approximate number of floors ascended. * * Only available on **iOS**. * * @since 0.0.1 */ floorsAscended?: number;
/** * The approximate number of floors descended. * * Only available on **iOS**. * * @since 0.0.1 */ floorsDescended?: number;
/** * The current pace (in seconds per meter). * * Only available on **iOS**. * * @since 0.0.1 */ currentPace?: number;
/** * The current cadence (steps per second). * * Only available on **iOS**. * * @since 0.0.1 */ currentCadence?: number;
/** * The average active pace (in seconds per meter). * * Only available on **iOS**. * * @since 0.0.1 */ averageActivePace?: number;
/** * The start time of this measurement (milliseconds since epoch). * * @since 0.0.1 */ startDate?: number;
/** * The end time of this measurement (milliseconds since epoch). * * @since 0.0.1 */ endDate?: number;}IsAvailableResult
__CAPGO_KEEP_1__export interface IsAvailableResult { /** * Whether step counting is available. * * @since 0.0.1 */ stepCounting: boolean;
/** * Whether distance measurement is available. * * Only `true` on **iOS** devices that support distance tracking. * * @since 0.0.1 */ distance: boolean;
/** * Whether pace measurement is available. * * Only `true` on **iOS** devices that support pace tracking. * * @since 0.0.1 */ pace: boolean;
/** * Whether cadence measurement is available. * * Only `true` on **iOS** devices that support cadence tracking. * * @since 0.0.1 */ cadence: boolean;
/** * Whether floor counting is available. * * Only `true` on **iOS** devices that support floor tracking. * * @since 0.0.1 */ floorCounting: boolean;}PermissionStatus
__CAPGO_KEEP_1__export interface PermissionStatus { /** * Permission state for activity recognition. * * On **Android**, this is the `ACTIVITY_RECOGNITION` permission. * On **iOS**, this is the motion usage permission. * * @since 0.0.1 */ activityRecognition: 'prompt' | 'prompt-with-rationale' | 'granted' | 'denied';}MeasurementEvent
__CAPGO_KEEP_1__export type MeasurementEvent = Measurement;__CAPGO_KEEP_3__
__CAPGO_KEEP_4____CAPGO_KEEP_5__ src/definitions.ts. upstream의 API이 변경되면 다시 싱크를 실행하세요.
Getting Started에서 계속 진행하세요.
Getting Started에서 계속 진행하세요.Getting Started를 사용하여 대시보드와 __CAPGO_KEEP_0__를 계획하고 운영할 때, __CAPGO_KEEP_0__를 연결하세요. Using @__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-pedometer Using @API/__CAPGO_KEEP_1__-pedometer Using @capgo/capacitor-pedometer for the native capability in Using @capgo/capacitor-pedometer, API Overview for the implementation detail in API Overview, __CAPGO_KEEP_0__ Overview __CAPGO_KEEP_0__ API 키 implementation 세부 정보에 대한 API 키 장치 implementation 세부 정보에 대한 장치.