컨텐츠로 건너뛰기

Getting Started

GitHub

__CAPGO_KEEP_11__

설치

Capgo AI 도구에 다음 명령어를 사용하여 Capgo 기능을 추가할 수 있습니다.

터미널 창
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins

만약에 __CAPGO_KEEP_0__ 기능을 사용하기 위해서는 다음 명령어를 사용하여 플러그인을 설치하고 아래의 플랫폼별 지침을 따르세요.

Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-pedometer` plugin in my project.

클립보드 복사

import
bun add @capgo/capacitor-pedometer
bunx cap sync
import { CapacitorPedometer } from '@capgo/capacitor-pedometer';

__CAPGO_KEEP_0__ 시간 범위 내歩数 측정값 가져오기.

import { CapacitorPedometer } from '@capgo/capacitor-pedometer';
await CapacitorPedometer.getMeasurement();

__CAPGO_KEEP_0__ 장치에서 사용 가능한歩数 기능 확인.

import { CapacitorPedometer } from '@capgo/capacitor-pedometer';
await CapacitorPedometer.isAvailable();

startMeasurementUpdates

__CAPGO_KEEP_0__ 제목

__CAPGO_KEEP_0__ 실시간歩数 측정값 업데이트 시작.

켜짐 안드로이드 and iOS, the measurement event는 startMeasurementUpdates().

import { CapacitorPedometer } from '@capgo/capacitor-pedometer';
await CapacitorPedometer.startMeasurementUpdates();

stopMeasurementUpdates

측정 업데이트 중단

Copy to clipboard

import { CapacitorPedometer } from '@capgo/capacitor-pedometer';
await CapacitorPedometer.stopMeasurementUpdates();

checkPermissions

Copy to clipboard

Check permission to access pedometer data.

On Android이러한 권한을 확인합니다. iOS에서 ACTIVITY_RECOGNITION 운동 사용 권한을 확인합니다. 클립보드에 복사권한 요청

import { CapacitorPedometer } from '@capgo/capacitor-pedometer';
await CapacitorPedometer.checkPermissions();

requestPermissions

Android에서

권한을 요청합니다. iOS에서

권한을 요청하여歩計 데이터에 접근합니다. 권한을 요청합니다.권한을 요청합니다. ACTIVITY_RECOGNITION 권한을 요청합니다. 권한을 요청합니다.이 요청의 운동 사용 권한을 허용합니다.

import { CapacitorPedometer } from '@capgo/capacitor-pedometer';
await CapacitorPedometer.requestPermissions();
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;
}
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공개 API이 업스트림에서 변경될 때 다시 싱크를 실행하세요.

Getting Started에서 계속

Getting Started에서 계속

Capacitor를 사용하는 경우 Getting Started 대시보드와 API를 계획하고 운영하기 위해, Using @capgo/capacitor-pedometer capgo의 내장 기능을 위한 Using @capacitor/capgo-pedometer, API 개요 API의 구현 세부 정보를 위한 API 개요, 소개 소개의 구현 세부 정보를 위한 API 키 API 키의 구현 세부 정보를 위한 , 장치 장치의 구현 세부 정보를 위한.