시작하기
설치 단계와 이 플러그인에 대한 전체 마크다운 가이드를 포함한 설정 프롬프트를 복사하세요.
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.
설치
설치bun add @capgo/capacitor-barometerbunx cap syncimport
importimport { CapacitorBarometer } from '@capgo/capacitor-barometer';API 개요
API 개요 제목getMeasurement
__CAPGO_KEEP_0__ 제목최근 바오메트로 측정값을 캡처한 네이티브 레이어에서 가져옵니다.
import { CapacitorBarometer } from '@capgo/capacitor-barometer';
await CapacitorBarometer.getMeasurement();isAvailable
__CAPGO_KEEP_0__ 여부현재 장치에 바오메트로 센서가 있는지 확인합니다.
import { CapacitorBarometer } from '@capgo/capacitor-barometer';
await CapacitorBarometer.isAvailable();startMeasurementUpdates
__CAPGO_KEEP_0__ 측정 업데이트 시작바오메트로 업데이트 스트리밍을 자바스크립트 레이어로 시작합니다.
Call with the measurement 업데이트를 받기 위한 이벤트.
import { CapacitorBarometer } from '@capgo/capacitor-barometer';
await CapacitorBarometer.startMeasurementUpdates();stopMeasurementUpdates
측정 업데이트 중단 섹션측정 업데이트 시작한 것을 중단하세요.
import { CapacitorBarometer } from '@capgo/capacitor-barometer';
await CapacitorBarometer.stopMeasurementUpdates();checkPermissions
권한 확인 섹션바로미터 데이터에 대한 현재 권한 상태를 반환합니다.
import { CapacitorBarometer } from '@capgo/capacitor-barometer';
await CapacitorBarometer.checkPermissions();requestPermissions
바로미터 데이터에 대한 권한 요청 섹션바로미터 데이터에 대한 권한 요청이 플랫폼에 의해 필요할 경우 권한을 요청합니다.
import { CapacitorBarometer } from '@capgo/capacitor-barometer';
await CapacitorBarometer.requestPermissions();타입 참조
타입 참조GetMeasurementResult
측정 결과 가져오기__CAPGO_KEEP_0__
export type GetMeasurementResult = Measurement;IsAvailableResult
사용 가능 여부 결과__CAPGO_KEEP_0__
export interface IsAvailableResult { /** * Indicates whether the device exposes a barometer sensor. * * @since 1.0.0 */ isAvailable: boolean;}PermissionStatus
권한 상태권한 정보
export interface PermissionStatus { /** * The permission state for accessing barometer measurements on the current platform. * * @since 1.0.0 */ barometer: BarometerPermissionState;}MeasurementEvent
측정 이벤트__CAPGO_KEEP_0__
export type MeasurementEvent = Measurement;Measurement
측정 섹션장치 бар로미터에서 압력 및 상대 고도 값을 샘플링합니다.
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
바로미터 권한 상태 섹션센서 접근을 제한할 수 있는 플랫폼을 위한 권한 상태 union limited 클립보드 복사
export type BarometerPermissionState = PermissionState | 'limited';PermissionState
__CAPGO_KEEP_0__이 지원하는 플랫폼 권한 상태Platform permission states supported by Capacitor.
export type PermissionState = 'prompt' | 'prompt-with-rationale' | 'granted' | 'denied';barometerPermissionState
실제 데이터의 원천이 페이지는 플러그인의 src/definitions.ts. upstream에서 public API이 변경되었을 때 다시 싱크를 실행하세요.