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 보조 설치를 사용하여 플러그인을 설치할 수 있습니다. 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.만약 Manual Setup을 선호한다면, 플러그인을 설치하기 위해 다음 명령어를 실행하고 아래의 플랫폼별 지침을 따르세요:
bun add @capgo/capacitor-barometerbunx cap syncimport
importimport { CapacitorBarometer } from '@capgo/capacitor-barometer';API 개요
API 개요getMeasurement
getMeasurement최신 바오메트르 센서 데이터를 가져옵니다.
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__바오메트르 센서 데이터를 지속적으로 업데이트합니다.
호출하여 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();타입 참조
Type ReferenceGetMeasurementResult
GetMeasurementResult최근 압력 샘플의 가장 최근 샘플입니다.
export type GetMeasurementResult = Measurement;IsAvailableResult
IsAvailableResult클라우드 플레어의 . 메서드에서 반환되는 결과입니다.
export interface IsAvailableResult { /** * Indicates whether the device exposes a barometer sensor. * * @since 1.0.0 */ isAvailable: boolean;}PermissionStatus
PermissionStatus클라우드 플레어의 및 메서드에서 반환되는 권한 정보입니다.
export interface PermissionStatus { /** * The permission state for accessing barometer measurements on the current platform. * * @since 1.0.0 */ barometer: BarometerPermissionState;}MeasurementEvent
MeasurementEvent측정 이벤트가 활성화될 때 발생하는 이벤트입니다.
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';Source Of Truth
Section titled “Source Of Truth”이 페이지는 플러그인의 src/definitions.ts. Re-run the sync when the public API changes upstream.
Getting Started에서 계속
Section titled “Getting Started에서 계속”이 플러그인을 사용하는 경우 Getting Started to plan dashboard and API operations, connect it with Using @capgo/capacitor-barometer Using @capgo/capacitor-barometer for the native capability in Using @API/__CAPGO_KEEP_1__-barometer for the implementation detail in API Overview, 소개 소개에 대한 구현 세부 정보를 위해 API 키 API 키에 대한 구현 세부 정보를 위해 장치 소개에 대한 구현 세부 정보를 위해