Getting Started
설치 단계와 이 플러그인의 전체 마크다운 가이드를 포함한 설정 지시를 복사하세요.
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-barometer`
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/barometer/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-barometer` plugin in my project.Copy to clipboard
bun add @capgo/capacitor-barometerbunx cap syncCopy to clipboard
Importimport { CapacitorBarometer } from '@capgo/capacitor-barometer';API Overview
API 개요getMeasurement
Section titled “__CAPGO_KEEP_0__ 개요”Section titled “getMeasurement”
import { CapacitorBarometer } from '@capgo/capacitor-barometer';
await CapacitorBarometer.getMeasurement();isAvailable
isAvailable기압 센서가 장착된 기기인지 확인합니다.
import { CapacitorBarometer } from '@capgo/capacitor-barometer';
await CapacitorBarometer.isAvailable();startMeasurementUpdates
startMeasurementUpdatesJavaScript layer로 기압 센서 데이터를 실시간으로 전송합니다.
__CAPGO_KEEP_0__ measurement 업데이트를 받기 위해 호출합니다.
import { CapacitorBarometer } from '@capgo/capacitor-barometer';
await CapacitorBarometer.startMeasurementUpdates();stopMeasurementUpdates
stopMeasurementUpdates기압 센서 데이터 업데이트를 중지합니다.
import { CapacitorBarometer } from '@capgo/capacitor-barometer';
await CapacitorBarometer.stopMeasurementUpdates();checkPermissions
checkPermissions현재 압력 센서 데이터 접근 권한 상태를 반환합니다.
import { CapacitorBarometer } from '@capgo/capacitor-barometer';
await CapacitorBarometer.checkPermissions();requestPermissions
requestPermissions압력 센서 데이터 접근을 위한 플랫폼의 요구에 따라 권한을 요청합니다.
import { CapacitorBarometer } from '@capgo/capacitor-barometer';
await CapacitorBarometer.requestPermissions();타입 참조
타입 참조GetMeasurementResult
압력 센서 측정 결과를 가져오기최근 압력 샘플의 별칭입니다.
export type GetMeasurementResult = Measurement;IsAvailableResult
압력 센서 사용 가능 여부 결과압력 센서 사용 가능 여부 결과를 반환합니다.
export interface IsAvailableResult { /** * Indicates whether the device exposes a barometer sensor. * * @since 1.0.0 */ isAvailable: boolean;}PermissionStatus
__CAPGO_KEEP_1____CAPGO_KEEP_2__
export interface PermissionStatus { /** * The permission state for accessing barometer measurements on the current platform. * * @since 1.0.0 */ barometer: BarometerPermissionState;}MeasurementEvent
__CAPGO_KEEP_1____CAPGO_KEEP_3__
export type MeasurementEvent = Measurement;Measurement
__CAPGO_KEEP_4____CAPGO_KEEP_5__
export interface Measurement { /** * The static air pressure in hectopascals (hPa). * * @since 1.0.0 */ pressure: number;
/** * The change in altitude relative to the time updates started. * Only available on iOS; Android will always return `0`. * * @since 1.0.0 */ relativeAltitude: number;
/** * The timestamp of the measurement in milliseconds since the Unix epoch. * * @since 1.0.0 */ timestamp: number;}BarometerPermissionState
__CAPGO_KEEP_6____CAPGO_KEEP_7__ limited for platforms that can throttle sensor access.
export type BarometerPermissionState = PermissionState | 'limited';PermissionState
제목: 권한 상태Capacitor에서 지원하는 플랫폼 권한 상태.
export type PermissionState = 'prompt' | 'prompt-with-rationale' | 'granted' | 'denied';진실의 근원
제목: 진실의 근원이 페이지는 플러그인의 src/definitions.ts. upstream에서 API의 공개 버전이 변경되면 다시 싱크를 실행하세요.
Getting Started에서 계속
제목: Getting Started에서 계속__CAPGO_KEEP_0__가 업스트림에서 변경되면 다시 싱크를 실행하세요. 시작하기 API 대시보드와 API 운영을 계획하고 연결하세요. @capgo/capacitor-barometer 사용하기 @capgo/capacitor-barometer의 원시 기능을 사용하기 위해 API 개요 API 개요의 구현 세부 사항을 참조하세요. 소개 소개의 구현 세부 사항을 참조하세요. API 키 API 키의 구현 세부 사항을 참조하세요. 그리고 장치 장치의 구현 세부 사항을 참조하세요.