__CAPGO_KEEP_0__ 시작
설치 단계와 이 플러그인의 전체 마크다운 가이드를 포함한 설정 지시를 복사하세요.
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.
설치
설치플러그인을 설치하기 위해 우리의 AI-assisted 설정을 사용할 수 있습니다. 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.만약 Manual Setup을 선호한다면, 플러그인을 설치하기 위해 다음 명령어를 실행하고 아래의 플랫폼에 따라서 지시를 따르세요:
bun add @capgo/capacitor-pedometerbunx cap syncImport
Import 섹션import { CapacitorPedometer } from '@capgo/capacitor-pedometer';API 개요
API 개요 섹션getMeasurement
getMeasurement 섹션지정된 시간 범위 내의步수計 측정치를 가져옵니다.
import { CapacitorPedometer } from '@capgo/capacitor-pedometer';
await CapacitorPedometer.getMeasurement();isAvailable
isAvailable 섹션이 장치에서 사용 가능한歩수計 기능을 확인합니다.
import { CapacitorPedometer } from '@capgo/capacitor-pedometer';
await CapacitorPedometer.isAvailable();startMeasurementUpdates
startMeasurementUpdates 섹션실시간 계단 수 측정 업데이트 받기
On Android 및 iOS, measurement 이벤트는 startMeasurementUpdates().
import { CapacitorPedometer } from '@capgo/capacitor-pedometer';
await CapacitorPedometer.startMeasurementUpdates();stopMeasurementUpdates
측정 업데이트 중지Copy to clipboard
import { CapacitorPedometer } from '@capgo/capacitor-pedometer';
await CapacitorPedometer.stopMeasurementUpdates();checkPermissions
권한 확인__CAPGO_KEEP_0__ 허용 여부를 확인하세요.
On 안드로이드__CAPGO_KEEP_1__에서 __CAPGO_KEEP_0__을 확인합니다.
__CAPGO_KEEP_2__에서 __CAPGO_KEEP_3__ 허용 여부를 확인합니다. ACTIVITY_RECOGNITION __CAPGO_KEEP_4__로 복사 __CAPGO_KEEP_5__ 제목 ‘requestPermissions’__CAPGO_KEEP_6__를 통해 __CAPGO_KEEP_0__ 허용 여부를 확인하세요.
import { CapacitorPedometer } from '@capgo/capacitor-pedometer';
await CapacitorPedometer.checkPermissions();requestPermissions
안드로이드__CAPGO_KEEP_7__에서 __CAPGO_KEEP_0__ 허용 여부를 확인합니다.
__CAPGO_KEEP_8__를 통해 __CAPGO_KEEP_0__ 허용 여부를 확인하세요. __CAPGO_KEEP_9__에서 __CAPGO_KEEP_0__ 허용 여부를 확인합니다., 이 요청은 ACTIVITY_RECOGNITION iOS , 이 요청은 운동 사용 허가의클립보드 복사
import { CapacitorPedometer } from '@capgo/capacitor-pedometer';
await CapacitorPedometer.requestPermissions();타입 참조 섹션 “타입 참조”
GetMeasurementOptions 섹션 “GetMeasurementOptions”GetMeasurementOptions
클립보드 복사export 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
클립보드 복사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
IsAvailableResult 섹션 “IsAvailableResult”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
권한 상태에 대한 섹션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
측정 이벤트에 대한 섹션export type MeasurementEvent = Measurement;실제 원천
실제 원천에 대한 섹션이 페이지는 플러그인의 src/definitions.ts. upstream에서 변경된 경우 pubic API를 다시 동기화하세요.
Getting Started에서 계속하세요
Getting Started에서 계속하세요에 대한 섹션이미 사용 중입니다. 시작하기 API 대시보드와 API 운영을 계획하고 연결하기 위해 @capgo/capacitor-pedometer 사용 @capgo/capacitor-pedometer 사용을 위한 capgo의 원천 기능 API 개요 API 개요의 구현 세부 정보 소개 소개의 구현 세부 정보 API 키 API 키의 구현 세부 정보 장치 장치의 구현 세부 정보