시작하기
이 플러그인의 설치 단계와 전체 마크다운 가이드가 포함된 설정 프롬프트를 복사하세요.
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-proximity`
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/proximity/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-proximitybunx cap sync수입
수입import { CapacitorProximity } from '@capgo/capacitor-proximity';API 개요
API 개요enable
활성화근접 모니터링 활성화
iOS에서 이 기능을 활성화하면 UIDevice.isProximityMonitoringEnabledAndroid에서 이 기능을 활성화하면 TYPE_PROXIMITY __CAPGO_KEEP_0__ 센서가 가려질 때 현재 앱 창을 어둡게 합니다.
import { CapacitorProximity } from '@capgo/capacitor-proximity';
await CapacitorProximity.enable();__CAPGO_KEEP_0__ 근접 센서 모니터링을 중지합니다.
__CAPGO_KEEP_0__ 기본 앱 창 동작을 복원하고 센서 모니터링을 중지합니다.
import { CapacitorProximity } from '@capgo/capacitor-proximity';
await CapacitorProximity.disable();getStatus
__CAPGO_KEEP_0__ 섹션 제목 ‘getStatus’__CAPGO_KEEP_0__ 현재 센서 사용 가능 상태와 플러그인 활성화 상태를 가져옵니다.
import { CapacitorProximity } from '@capgo/capacitor-proximity';
const status = await CapacitorProximity.getStatus();__CAPGO_KEEP_0__ 타입 참조
__CAPGO_KEEP_0__ 섹션 제목 ‘Type Reference’ProximityStatusResult
__CAPGO_KEEP_0__ 섹션 제목 ‘ProximityStatusResult’__CAPGO_KEEP_0__ 반환 결과 getStatus().
export interface ProximityStatusResult { /** * Whether the current device exposes a usable proximity sensor. * * @since 0.0.1 */ available: boolean;
/** * Whether proximity monitoring is currently enabled by the plugin. * * @since 0.0.1 */ enabled: boolean;
/** * Platform label returned by the native or web implementation. * * @since 0.0.1 */ platform: 'ios' | 'android' | 'web';}PluginVersionResult
버전 결과 플러그인 섹션플러그인 버전을 요청할 때 반환되는 결과.
export interface PluginVersionResult { /** * Native plugin version string. * * @since 0.0.1 */ version: string;}진실의 근원
진실의 근원 섹션이 페이지는 플러그인의 src/definitions.tsAPI이 업스트림에서 변경될 때 다시 동기화할 수 있습니다.