시작하기
복사할 수 있는 설치 프롬프트와 이 플러그인의 전체 마크다운 가이드를 포함합니다.
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__ 측정 업데이트 시작바오메트르 측정값을 자바스크립트层로 스트리밍합니다.
with 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
측정 결과 가져오기 섹션최근 압력 샘플의 가장 최근 alias입니다.
export type GetMeasurementResult = Measurement;IsAvailableResult
IsAvailableResult 섹션함수에 의해 반환되는 결과입니다.
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
측정 이벤트 섹션활성화된 경우에 발생하는 이벤트 페이로드입니다.
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
제목: '진실의 근원'이 페이지는 플러그인의 src/definitions.ts. 다시 싱크를 실행할 때 upstream의 공공 API이 변경되면.
Getting Started에서 계속
제목: 'Getting Started에서 계속'이 플러그인을 사용하는 경우 Getting Started 계획 대시보드 및 API 운영을 위해 Using @capgo/capacitor-barometer Using @capgo/capacitor-barometer Using @API/__CAPGO_KEEP_1__-barometer for the native capability in Using @API/__CAPGO_KEEP_1__-barometer, 소개 소개에 대한 구현 세부 정보를 위해 API 키 API 키에 대한 구현 세부 정보를 위해, 및 장치 소개에 대한 구현 세부 정보를 위해